Ensure minibuffer input is added to history in read_minibuf
* src/minibuf.c (read_minibuf): Parse input string after saving the string to the history list instead of before, in case parsing signals an error or is interrupted by C-g. (Bug#39291)
This commit is contained in:
parent
de41161534
commit
2e66013dcf
1 changed files with 4 additions and 4 deletions
|
@ -696,10 +696,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
|
||||||
else
|
else
|
||||||
histstring = Qnil;
|
histstring = Qnil;
|
||||||
|
|
||||||
/* If Lisp form desired instead of string, parse it. */
|
|
||||||
if (expflag)
|
|
||||||
val = string_to_object (val, defalt);
|
|
||||||
|
|
||||||
/* The appropriate frame will get selected
|
/* The appropriate frame will get selected
|
||||||
in set-window-configuration. */
|
in set-window-configuration. */
|
||||||
unbind_to (count, Qnil);
|
unbind_to (count, Qnil);
|
||||||
|
@ -710,6 +706,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
|
||||||
if (! (NILP (Vhistory_add_new_input) || NILP (histstring)))
|
if (! (NILP (Vhistory_add_new_input) || NILP (histstring)))
|
||||||
call2 (intern ("add-to-history"), histvar, histstring);
|
call2 (intern ("add-to-history"), histvar, histstring);
|
||||||
|
|
||||||
|
/* If Lisp form desired instead of string, parse it. */
|
||||||
|
if (expflag)
|
||||||
|
val = string_to_object (val, defalt);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue