Commit a2f90498 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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.
parent d10c3eda
2015-02-19 Eli Zaretskii <eliz@gnu.org>
* 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. (Bug#19774)
2015-02-19 Fujii Hironori <fujii.hironori@gmail.com> (tiny change)
 
* w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Pass the
......
......@@ -3034,6 +3034,7 @@ read_char (int commandflag, Lisp_Object map,
Lisp_Object keys;
ptrdiff_t key_count;
bool key_count_reset;
ptrdiff_t command_key_start;
struct gcpro gcpro1;
ptrdiff_t count = SPECPDL_INDEX ();
......@@ -3057,6 +3058,7 @@ read_char (int commandflag, Lisp_Object map,
/* Save the this_command_keys status. */
key_count = this_command_key_count;
key_count_reset = this_command_key_count_reset;
command_key_start = this_single_command_key_start;
if (key_count > 0)
keys = Fcopy_sequence (this_command_keys);
......@@ -3067,6 +3069,7 @@ read_char (int commandflag, Lisp_Object map,
/* Clear out this_command_keys. */
this_command_key_count = 0;
this_command_key_count_reset = 0;
this_single_command_key_start = 0;
/* Now wipe the echo area. */
if (!NILP (echo_area_buffer[0]))
......@@ -3090,6 +3093,7 @@ read_char (int commandflag, Lisp_Object map,
and this_command_keys state. */
this_command_key_count = key_count;
this_command_key_count_reset = key_count_reset;
this_single_command_key_start = command_key_start;
if (key_count > 0)
this_command_keys = keys;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment