From 1503d26aa07983b9c0c06b8d10a570a63eee7515 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 18 Jun 2014 23:48:18 -0400 Subject: [PATCH] * src/keyboard.c (read_key_sequence): Don't invoke Vprefix_help_command before checking key-translation-map. Fixes: debbugs:17659 --- src/ChangeLog | 5 +++++ src/keyboard.c | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6869116416a..58e3eab8339 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-06-19 Stefan Monnier + + * keyboard.c (read_key_sequence): Don't invoke Vprefix_help_command + before checking key-translation-map (bug#17659). + 2014-06-19 Dmitry Antipov * font.c (font_make_object): Avoid dangling pointer which may diff --git a/src/keyboard.c b/src/keyboard.c index 8bc0c108739..eb27d6fefab 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2197,7 +2197,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, -/* Input of single characters from keyboard */ +/* Input of single characters from keyboard. */ static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu, struct timespec *end_time); @@ -3656,7 +3656,8 @@ kbd_buffer_store_event_hold (register struct input_event *event, *kbd_store_ptr = *event; ++kbd_store_ptr; #ifdef subprocesses - if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ()) + if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE / 2 + && ! kbd_on_hold_p ()) { /* Don't read keyboard input until we have processed kbd_buffer. This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ @@ -9384,16 +9385,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, first_unbound = min (t, first_unbound); head = EVENT_HEAD (key); - if (help_char_p (head) && t > 0) - { - read_key_sequence_cmd = Vprefix_help_command; - keybuf[t++] = key; - last_nonmenu_event = key; - /* The Microsoft C compiler can't handle the goto that - would go here. */ - dummyflag = 1; - break; - } if (SYMBOLP (head)) { @@ -9651,6 +9642,17 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, goto replay_sequence; } + + if (NILP (current_binding) + && help_char_p (EVENT_HEAD (key)) && t > 1) + { + read_key_sequence_cmd = Vprefix_help_command; + /* The Microsoft C compiler can't handle the goto that + would go here. */ + dummyflag = 1; + break; + } + /* If KEY is not defined in any of the keymaps, and cannot be part of a function key or translation, and is a shifted function key, -- 2.11.4.GIT