Commit 6e5742a0 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Freset_this_command_lengths): Return nil.

(read_char): [All these changes are in the input method code.]
Process and clear before_command_restore_flag before the input method.
Save and restore ok_to_echo_at_next_pause and
current_kboard->echo_after_prompt.
Save, copy and empty this_command_keys, if it is not empty.
Clear the echo area before the input method.
Then in all cases restore this_command_keys, and reenable echoing
if it was enabled before.
parent 00e25b96
...@@ -2363,24 +2363,64 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) ...@@ -2363,24 +2363,64 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
&& (unsigned) XINT (c) < 127) && (unsigned) XINT (c) < 127)
{ {
Lisp_Object keys; Lisp_Object keys;
int key_count = this_command_key_count; int key_count;
int saved = current_kboard->immediate_echo;
struct gcpro gcpro1; struct gcpro gcpro1;
/* Save the echo status. */
int saved_immediate_echo = current_kboard->immediate_echo;
char *saved_ok_to_echo = ok_to_echo_at_next_pause;
int saved_echo_after_prompt = current_kboard->echo_after_prompt;
if (before_command_restore_flag)
{
this_command_key_count = before_command_key_count_1;
if (this_command_key_count < this_single_command_key_start)
this_single_command_key_start = this_command_key_count;
echo_truncate (before_command_echo_length_1);
before_command_restore_flag = 0;
}
/* Save the this_command_keys status. */
key_count = this_command_key_count;
if (key_count > 0)
keys = Fcopy_sequence (this_command_keys); keys = Fcopy_sequence (this_command_keys);
else
keys = Qnil;
GCPRO1 (keys); GCPRO1 (keys);
/* Clear out this_command_keys. */
this_command_key_count = 0;
/* Now wipe the echo area. */
if (echo_area_glyphs)
safe_run_hooks (Qecho_area_clear_hook);
echo_area_glyphs = 0;
echo_truncate (0);
/* Call the input method. */
tem = call1 (Vinput_method_function, c); tem = call1 (Vinput_method_function, c);
/* Restore the saved echoing state
and this_command_keys state. */
this_command_key_count = key_count;
if (key_count > 0)
this_command_keys = keys;
cancel_echoing ();
ok_to_echo_at_next_pause = saved_ok_to_echo;
current_kboard->echo_after_prompt = saved_echo_after_prompt;
if (saved_immediate_echo)
echo_now ();
UNGCPRO; UNGCPRO;
current_kboard->immediate_echo = saved;
/* The input method can return no events. */ /* The input method can return no events. */
if (! CONSP (tem)) if (! CONSP (tem))
{ {
/* Bring back the previous message, if any. */ /* Bring back the previous message, if any. */
if (! NILP (Vinput_method_previous_message)) if (! NILP (echo_area_message))
message_with_string ("%s", echo_area_message, 0); message_with_string ("%s", echo_area_message, 0);
this_command_keys = keys;
this_command_key_count = key_count;
cancel_echoing ();
goto retry; goto retry;
} }
/* It returned one event or more. */ /* It returned one event or more. */
...@@ -8175,6 +8215,7 @@ appears in the echo area and in the value of `this-command-keys.'.") ...@@ -8175,6 +8215,7 @@ appears in the echo area and in the value of `this-command-keys.'.")
before_command_restore_flag = 1; before_command_restore_flag = 1;
before_command_key_count_1 = before_command_key_count; before_command_key_count_1 = before_command_key_count;
before_command_echo_length_1 = before_command_echo_length; before_command_echo_length_1 = before_command_echo_length;
return Qnil;
} }
DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0, DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0,
......
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