]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix execution of tool-bar commands read within minibuffer-error-handler
authorPo Lu <luangruo@yahoo.com>
Fri, 21 Jun 2024 07:12:07 +0000 (15:12 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 21 Jun 2024 19:01:44 +0000 (21:01 +0200)
* src/keyboard.c (read_char): Arrange that the original event be
recorded when a posn is promoted to a prefix key and an END_TIME
is suppressing additions to this_command_keys.

(cherry picked from commit 0ade6348f92283e4fd0bc209f100d8fe1bb87d2a)

src/keyboard.c

index 6dfe6723aec04a93efaf0cb5067b273f6e2e3d3f..303af00550b241a5d8a5b86bc9ee942f850278f6 100644 (file)
@@ -3135,8 +3135,23 @@ read_char (int commandflag, Lisp_Object map,
          /* Change menu-bar to (menu-bar) as the event "position".  */
          POSN_SET_POSN (xevent_start (c), list1 (posn));
 
-         also_record = c;
-         Vunread_command_events = Fcons (c, Vunread_command_events);
+         /* Should a command call `sit-for', or another command that
+            provides a timespec to Fread_event and co., the original
+            event will not subsequently be entered into
+            this_command_keys unless Qno_record be specified below.
+
+            The same is the case in a number of other scenarios where
+            reread is true, but if so, event recording is to be
+            suppressed anyway.  */
+
+         if (end_time)
+           Vunread_command_events = Fcons (Fcons (Qt, c),
+                                           Vunread_command_events);
+         else
+           {
+             also_record = c;
+             Vunread_command_events = Fcons (c, Vunread_command_events);
+           }
          c = posn;
        }
     }