aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-08-10 21:15:03 +0300
committerEli Zaretskii2015-08-10 21:15:03 +0300
commit30a6b1f81412044aa7dda5573b0142a0a03c4fd3 (patch)
treef81efe68a19c31a2269c5fe87af6bf79e69c9035 /src
parent3985a21b5205d65bece84d1ba74f44478db78d91 (diff)
downloademacs-30a6b1f81412044aa7dda5573b0142a0a03c4fd3.tar.gz
emacs-30a6b1f81412044aa7dda5573b0142a0a03c4fd3.zip
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 <dak@gnu.org>, see http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00193.html.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c13
1 files changed, 12 insertions, 1 deletions
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,
2387 Lisp_Object tem, save; 2387 Lisp_Object tem, save;
2388 volatile Lisp_Object previous_echo_area_message; 2388 volatile Lisp_Object previous_echo_area_message;
2389 volatile Lisp_Object also_record; 2389 volatile Lisp_Object also_record;
2390 volatile bool reread; 2390 volatile bool reread, recorded;
2391 struct gcpro gcpro1, gcpro2; 2391 struct gcpro gcpro1, gcpro2;
2392 bool volatile polling_stopped_here = 0; 2392 bool volatile polling_stopped_here = 0;
2393 struct kboard *orig_kboard = current_kboard; 2393 struct kboard *orig_kboard = current_kboard;
@@ -2405,6 +2405,8 @@ read_char (int commandflag, Lisp_Object map,
2405 2405
2406 retry: 2406 retry:
2407 2407
2408 recorded = false;
2409
2408 if (CONSP (Vunread_post_input_method_events)) 2410 if (CONSP (Vunread_post_input_method_events))
2409 { 2411 {
2410 c = XCAR (Vunread_post_input_method_events); 2412 c = XCAR (Vunread_post_input_method_events);
@@ -2994,6 +2996,7 @@ read_char (int commandflag, Lisp_Object map,
2994 /* Store these characters into recent_keys, the dribble file if any, 2996 /* Store these characters into recent_keys, the dribble file if any,
2995 and the keyboard macro being defined, if any. */ 2997 and the keyboard macro being defined, if any. */
2996 record_char (c); 2998 record_char (c);
2999 recorded = true;
2997 if (! NILP (also_record)) 3000 if (! NILP (also_record))
2998 record_char (also_record); 3001 record_char (also_record);
2999 3002
@@ -3129,6 +3132,14 @@ read_char (int commandflag, Lisp_Object map,
3129 Vunread_post_input_method_events 3132 Vunread_post_input_method_events
3130 = nconc2 (XCDR (tem), Vunread_post_input_method_events); 3133 = nconc2 (XCDR (tem), Vunread_post_input_method_events);
3131 } 3134 }
3135 /* When we consume events from the various unread-*-events lists, we
3136 bypass the code that records input, so record these events now if
3137 they were not recorded already. */
3138 if (!recorded)
3139 {
3140 record_char (c);
3141 recorded = true;
3142 }
3132 3143
3133 reread_first: 3144 reread_first:
3134 3145