aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorEli Zaretskii2015-02-19 18:48:39 +0200
committerEli Zaretskii2015-02-19 18:48:39 +0200
commita2f904981d10d68bd84b6c7233a79094f052fa8a (patch)
tree541b3873cce7ab8d1c57f4822426460400a77df3 /src/keyboard.c
parentd10c3edaf21ebbc424d452f3f0ca5c1e51487201 (diff)
downloademacs-a2f904981d10d68bd84b6c7233a79094f052fa8a.tar.gz
emacs-a2f904981d10d68bd84b6c7233a79094f052fa8a.zip
Avoid aborts when input-method-function changes this-command-keys (Bug#19774)
src/keyboard.c (read_char): Make sure this_single_command_key_start is in sync with this_command_key_count, around the call to input-method-function.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4f6a4414a04..ab57553e7d3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3034,6 +3034,7 @@ read_char (int commandflag, Lisp_Object map,
3034 Lisp_Object keys; 3034 Lisp_Object keys;
3035 ptrdiff_t key_count; 3035 ptrdiff_t key_count;
3036 bool key_count_reset; 3036 bool key_count_reset;
3037 ptrdiff_t command_key_start;
3037 struct gcpro gcpro1; 3038 struct gcpro gcpro1;
3038 ptrdiff_t count = SPECPDL_INDEX (); 3039 ptrdiff_t count = SPECPDL_INDEX ();
3039 3040
@@ -3057,6 +3058,7 @@ read_char (int commandflag, Lisp_Object map,
3057 /* Save the this_command_keys status. */ 3058 /* Save the this_command_keys status. */
3058 key_count = this_command_key_count; 3059 key_count = this_command_key_count;
3059 key_count_reset = this_command_key_count_reset; 3060 key_count_reset = this_command_key_count_reset;
3061 command_key_start = this_single_command_key_start;
3060 3062
3061 if (key_count > 0) 3063 if (key_count > 0)
3062 keys = Fcopy_sequence (this_command_keys); 3064 keys = Fcopy_sequence (this_command_keys);
@@ -3067,6 +3069,7 @@ read_char (int commandflag, Lisp_Object map,
3067 /* Clear out this_command_keys. */ 3069 /* Clear out this_command_keys. */
3068 this_command_key_count = 0; 3070 this_command_key_count = 0;
3069 this_command_key_count_reset = 0; 3071 this_command_key_count_reset = 0;
3072 this_single_command_key_start = 0;
3070 3073
3071 /* Now wipe the echo area. */ 3074 /* Now wipe the echo area. */
3072 if (!NILP (echo_area_buffer[0])) 3075 if (!NILP (echo_area_buffer[0]))
@@ -3090,6 +3093,7 @@ read_char (int commandflag, Lisp_Object map,
3090 and this_command_keys state. */ 3093 and this_command_keys state. */
3091 this_command_key_count = key_count; 3094 this_command_key_count = key_count;
3092 this_command_key_count_reset = key_count_reset; 3095 this_command_key_count_reset = key_count_reset;
3096 this_single_command_key_start = command_key_start;
3093 if (key_count > 0) 3097 if (key_count > 0)
3094 this_command_keys = keys; 3098 this_command_keys = keys;
3095 3099