From: Eli Zaretskii Date: Mon, 10 Aug 2015 18:15:03 +0000 (+0300) Subject: Fix recording of events pushed onto unread-command-events X-Git-Tag: emacs-25.0.90~1373^2~67 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=30a6b1f81412044aa7dda5573b0142a0a03c4fd3;p=emacs.git Fix recording of events pushed onto unread-command-events * src/keyboard.c (read_char): Make sure events read from unread-command-events and unread-post-input-method-events are always recorded by record_char. Reported by David Kastrup , see http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00193.html. --- diff --git a/src/keyboard.c b/src/keyboard.c index e4fe5b9bb4c..f670da3db5e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2387,7 +2387,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object tem, save; volatile Lisp_Object previous_echo_area_message; volatile Lisp_Object also_record; - volatile bool reread; + volatile bool reread, recorded; struct gcpro gcpro1, gcpro2; bool volatile polling_stopped_here = 0; struct kboard *orig_kboard = current_kboard; @@ -2405,6 +2405,8 @@ read_char (int commandflag, Lisp_Object map, retry: + recorded = false; + if (CONSP (Vunread_post_input_method_events)) { c = XCAR (Vunread_post_input_method_events); @@ -2994,6 +2996,7 @@ read_char (int commandflag, Lisp_Object map, /* Store these characters into recent_keys, the dribble file if any, and the keyboard macro being defined, if any. */ record_char (c); + recorded = true; if (! NILP (also_record)) record_char (also_record); @@ -3129,6 +3132,14 @@ read_char (int commandflag, Lisp_Object map, Vunread_post_input_method_events = nconc2 (XCDR (tem), Vunread_post_input_method_events); } + /* When we consume events from the various unread-*-events lists, we + bypass the code that records input, so record these events now if + they were not recorded already. */ + if (!recorded) + { + record_char (c); + recorded = true; + } reread_first: