aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index fe6686525ce..74cf3d79157 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -126,9 +126,16 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
126 Lisp_Object histvar; 126 Lisp_Object histvar;
127 Lisp_Object histpos; 127 Lisp_Object histpos;
128{ 128{
129 register Lisp_Object val; 129 Lisp_Object val;
130 int count = specpdl_ptr - specpdl; 130 int count = specpdl_ptr - specpdl;
131 Lisp_Object mini_frame; 131 Lisp_Object mini_frame;
132 struct gcpro gcpro1, gcpro2, gcpro3;
133
134 val = Qnil;
135 /* Don't need to protect PROMPT, HISTVAR, and HISTPOS because we
136 store them away before we can GC. Don't need to protect
137 BACKUP_N because we use the value only if it is an integer. */
138 GCPRO3 (map, initial, val);
132 139
133 if (!STRINGP (prompt)) 140 if (!STRINGP (prompt))
134 prompt = build_string (""); 141 prompt = build_string ("");
@@ -154,7 +161,10 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
154 Fcons (Vminibuffer_history_position, 161 Fcons (Vminibuffer_history_position,
155 Fcons (Vminibuffer_history_variable, 162 Fcons (Vminibuffer_history_variable,
156 minibuf_save_list)))))); 163 minibuf_save_list))))));
157 minibuf_prompt_width = 0; 164 minibuf_prompt_width = 0; /* xdisp.c puts in the right value. */
165 minibuf_prompt = Fcopy_sequence (prompt);
166 Vminibuffer_history_position = histpos;
167 Vminibuffer_history_variable = histvar;
158 168
159 record_unwind_protect (Fset_window_configuration, 169 record_unwind_protect (Fset_window_configuration,
160 Fcurrent_window_configuration (Qnil)); 170 Fcurrent_window_configuration (Qnil));
@@ -231,15 +241,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
231 Fforward_char (backup_n); 241 Fforward_char (backup_n);
232 } 242 }
233 243
234 minibuf_prompt = Fcopy_sequence (prompt);
235 echo_area_glyphs = 0; 244 echo_area_glyphs = 0;
236 /* This is in case the minibuffer-setup-hook calls Fsit_for. */ 245 /* This is in case the minibuffer-setup-hook calls Fsit_for. */
237 previous_echo_glyphs = 0; 246 previous_echo_glyphs = 0;
238 247
239 Vhelp_form = Vminibuffer_help_form; 248 Vhelp_form = Vminibuffer_help_form;
240 current_buffer->keymap = map; 249 current_buffer->keymap = map;
241 Vminibuffer_history_position = histpos;
242 Vminibuffer_history_variable = histvar;
243 250
244 /* Run our hook, but not if it is empty. 251 /* Run our hook, but not if it is empty.
245 (run-hooks would do nothing if it is empty, 252 (run-hooks would do nothing if it is empty,
@@ -301,8 +308,9 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
301 val = Fcar (expr_and_pos); 308 val = Fcar (expr_and_pos);
302 } 309 }
303 310
304 return unbind_to (count, val); /* The appropriate frame will get selected 311 /* The appropriate frame will get selected
305 in set-window-configuration. */ 312 in set-window-configuration. */
313 RETURN_UNGCPRO (unbind_to (count, val));
306} 314}
307 315
308/* Return a buffer to be used as the minibuffer at depth `depth'. 316/* Return a buffer to be used as the minibuffer at depth `depth'.