diff options
| author | Federico Tedin | 2020-01-29 22:24:40 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2020-01-31 11:17:41 +0200 |
| commit | 2e66013dcf1e139436cc806725e0b04945be55a9 (patch) | |
| tree | d973884fe9f6ce4e02ae63f1328d55abe2c20894 /src | |
| parent | de411615344d1551d685e45b0739e1f738cf4afd (diff) | |
| download | emacs-2e66013dcf1e139436cc806725e0b04945be55a9.tar.gz emacs-2e66013dcf1e139436cc806725e0b04945be55a9.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index c5f61456900..b837cc53eb9 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -696,10 +696,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 696 | else | 696 | else |
| 697 | histstring = Qnil; | 697 | histstring = Qnil; |
| 698 | 698 | ||
| 699 | /* If Lisp form desired instead of string, parse it. */ | ||
| 700 | if (expflag) | ||
| 701 | val = string_to_object (val, defalt); | ||
| 702 | |||
| 703 | /* The appropriate frame will get selected | 699 | /* The appropriate frame will get selected |
| 704 | in set-window-configuration. */ | 700 | in set-window-configuration. */ |
| 705 | unbind_to (count, Qnil); | 701 | unbind_to (count, Qnil); |
| @@ -710,6 +706,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, | |||
| 710 | if (! (NILP (Vhistory_add_new_input) || NILP (histstring))) | 706 | if (! (NILP (Vhistory_add_new_input) || NILP (histstring))) |
| 711 | call2 (intern ("add-to-history"), histvar, histstring); | 707 | call2 (intern ("add-to-history"), histvar, histstring); |
| 712 | 708 | ||
| 709 | /* If Lisp form desired instead of string, parse it. */ | ||
| 710 | if (expflag) | ||
| 711 | val = string_to_object (val, defalt); | ||
| 712 | |||
| 713 | return val; | 713 | return val; |
| 714 | } | 714 | } |
| 715 | 715 | ||