diff options
| author | Jim Blandy | 1992-11-16 00:46:19 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-11-16 00:46:19 +0000 |
| commit | 64a3a3c0b4ff590ca41431dd4287d234f4fd6349 (patch) | |
| tree | 3aa1afd099042242165a0f4934f2496237af464c /src | |
| parent | 2705099422b12fb373afdc6781a28b9aef4ba823 (diff) | |
| download | emacs-64a3a3c0b4ff590ca41431dd4287d234f4fd6349.tar.gz emacs-64a3a3c0b4ff590ca41431dd4287d234f4fd6349.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 62de9d9b15a..c3625565000 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -161,7 +161,35 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) | |||
| 161 | 161 | ||
| 162 | val = current_buffer->directory; | 162 | val = current_buffer->directory; |
| 163 | Fset_buffer (get_minibuffer (minibuf_level)); | 163 | Fset_buffer (get_minibuffer (minibuf_level)); |
| 164 | current_buffer->directory = val; | 164 | |
| 165 | /* The current buffer's default directory is usually the right thing | ||
| 166 | for our minibuffer here. However, if you're typing a command at | ||
| 167 | a minibuffer-only frame when minibuf_level is zero, then buf IS | ||
| 168 | the current_buffer, so reset_buffer leaves buf's default | ||
| 169 | directory unchanged. This is a bummer when you've just started | ||
| 170 | up Emacs and buf's default directory is Qnil. Here's a hack; can | ||
| 171 | you think of something better to do? Find another buffer with a | ||
| 172 | better directory, and use that one instead. */ | ||
| 173 | if (XTYPE (val) == Lisp_String) | ||
| 174 | current_buffer->directory = val; | ||
| 175 | else | ||
| 176 | { | ||
| 177 | Lisp_Object buf_list; | ||
| 178 | |||
| 179 | for (buf_list = Vbuffer_alist; | ||
| 180 | CONSP (buf_list); | ||
| 181 | buf_list = XCONS (buf_list)->cdr) | ||
| 182 | { | ||
| 183 | Lisp_Object other_buf = XCONS (XCONS (buf_list)->car)->cdr; | ||
| 184 | |||
| 185 | if (XTYPE (XBUFFER (other_buf)->directory) == Lisp_String) | ||
| 186 | { | ||
| 187 | current_buffer->directory = XBUFFER (other_buf)->directory; | ||
| 188 | break; | ||
| 189 | } | ||
| 190 | } | ||
| 191 | } | ||
| 192 | |||
| 165 | #ifdef MULTI_FRAME | 193 | #ifdef MULTI_FRAME |
| 166 | Fredirect_frame_focus (Fselected_frame (), mini_frame); | 194 | Fredirect_frame_focus (Fselected_frame (), mini_frame); |
| 167 | #endif | 195 | #endif |
| @@ -265,6 +293,7 @@ get_minibuffer (depth) | |||
| 265 | } | 293 | } |
| 266 | else | 294 | else |
| 267 | reset_buffer (XBUFFER (buf)); | 295 | reset_buffer (XBUFFER (buf)); |
| 296 | |||
| 268 | return buf; | 297 | return buf; |
| 269 | } | 298 | } |
| 270 | 299 | ||
| @@ -901,7 +930,7 @@ temp_echo_area_glyphs (m) | |||
| 901 | if (!NILP (Vquit_flag)) | 930 | if (!NILP (Vquit_flag)) |
| 902 | { | 931 | { |
| 903 | Vquit_flag = Qnil; | 932 | Vquit_flag = Qnil; |
| 904 | XFASTINT (unread_command_char) = Ctl ('g'); | 933 | XFASTINT (unread_command_event) = Ctl ('g'); |
| 905 | } | 934 | } |
| 906 | Vinhibit_quit = oinhibit; | 935 | Vinhibit_quit = oinhibit; |
| 907 | } | 936 | } |