# HG changeset patch # User Jim Blandy # Date 721874779 0 # Node ID a3862c6dfcd0cdc1f22f21e9fad6f0bfb46650d5 # Parent 613783a3f00cc5278f002c4e097f02b0e39ad0da * minibuf.c (temp_echo_area_glyphs): Change reference to unread_command_char to unread_command_event. * minibuf.c (read_minibuf): If get_minibuffer gives the new minibuffer a nil default directory, find another buffer with a better default directory and use that one's instead. diff -r 613783a3f00c -r a3862c6dfcd0 src/minibuf.c --- a/src/minibuf.c Mon Nov 16 00:45:34 1992 +0000 +++ b/src/minibuf.c Mon Nov 16 00:46:19 1992 +0000 @@ -161,7 +161,35 @@ val = current_buffer->directory; Fset_buffer (get_minibuffer (minibuf_level)); - current_buffer->directory = val; + + /* The current buffer's default directory is usually the right thing + for our minibuffer here. However, if you're typing a command at + a minibuffer-only frame when minibuf_level is zero, then buf IS + the current_buffer, so reset_buffer leaves buf's default + directory unchanged. This is a bummer when you've just started + up Emacs and buf's default directory is Qnil. Here's a hack; can + you think of something better to do? Find another buffer with a + better directory, and use that one instead. */ + if (XTYPE (val) == Lisp_String) + current_buffer->directory = val; + else + { + Lisp_Object buf_list; + + for (buf_list = Vbuffer_alist; + CONSP (buf_list); + buf_list = XCONS (buf_list)->cdr) + { + Lisp_Object other_buf = XCONS (XCONS (buf_list)->car)->cdr; + + if (XTYPE (XBUFFER (other_buf)->directory) == Lisp_String) + { + current_buffer->directory = XBUFFER (other_buf)->directory; + break; + } + } + } + #ifdef MULTI_FRAME Fredirect_frame_focus (Fselected_frame (), mini_frame); #endif @@ -265,6 +293,7 @@ } else reset_buffer (XBUFFER (buf)); + return buf; } @@ -901,7 +930,7 @@ if (!NILP (Vquit_flag)) { Vquit_flag = Qnil; - XFASTINT (unread_command_char) = Ctl ('g'); + XFASTINT (unread_command_event) = Ctl ('g'); } Vinhibit_quit = oinhibit; }