]> git.eshelyaron.com Git - emacs.git/commitdiff
Preserve this-command-keys across recursive-edit invocations
authorEli Zaretskii <eliz@gnu.org>
Fri, 28 Jul 2017 12:40:25 +0000 (15:40 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 28 Jul 2017 12:40:25 +0000 (15:40 +0300)
* src/minibuf.c (read_minibuf, read_minibuf_unwind): Save and
restore this-command-keys, to preserve it across recursive-edit.
(Bug#27470)

src/minibuf.c

index d4128ce01c146f4eef2db3b408ed60f330f9516b..010152930bcf4821a9d6db44047320d3d48f3769 100644 (file)
@@ -497,6 +497,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
                                  Fcons (Vminibuffer_history_position,
                                         Fcons (Vminibuffer_history_variable,
                                                minibuf_save_list))))));
+  minibuf_save_list
+    = Fcons (Fthis_command_keys_vector (), minibuf_save_list);
 
   record_unwind_protect_void (read_minibuf_unwind);
   minibuf_level++;
@@ -836,6 +838,11 @@ read_minibuf_unwind (void)
   Fset_buffer (XWINDOW (window)->contents);
 
   /* Restore prompt, etc, from outer minibuffer level.  */
+  Lisp_Object key_vec = Fcar (minibuf_save_list);
+  eassert (VECTORP (key_vec));
+  this_command_key_count = XFASTINT (Flength (key_vec));
+  this_command_keys = key_vec;
+  minibuf_save_list = Fcdr (minibuf_save_list);
   minibuf_prompt = Fcar (minibuf_save_list);
   minibuf_save_list = Fcdr (minibuf_save_list);
   minibuf_prompt_width = XFASTINT (Fcar (minibuf_save_list));