diff options
| author | Richard M. Stallman | 1998-08-17 07:04:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-08-17 07:04:41 +0000 |
| commit | 6e5742a05b9be276e01650ae1e1af70a9d7c5c4d (patch) | |
| tree | 6e87cfb1268df4282ea5098ee5c6310879d20115 /src | |
| parent | 00e25b96d4690028ddda928eae6470e00472eadc (diff) | |
| download | emacs-6e5742a05b9be276e01650ae1e1af70a9d7c5c4d.tar.gz emacs-6e5742a05b9be276e01650ae1e1af70a9d7c5c4d.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 2afeca31242..dc264fc62f8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2363,24 +2363,64 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2363 | && (unsigned) XINT (c) < 127) | 2363 | && (unsigned) XINT (c) < 127) |
| 2364 | { | 2364 | { |
| 2365 | Lisp_Object keys; | 2365 | Lisp_Object keys; |
| 2366 | int key_count = this_command_key_count; | 2366 | int key_count; |
| 2367 | int saved = current_kboard->immediate_echo; | ||
| 2368 | struct gcpro gcpro1; | 2367 | struct gcpro gcpro1; |
| 2369 | 2368 | ||
| 2370 | keys = Fcopy_sequence (this_command_keys); | 2369 | /* Save the echo status. */ |
| 2370 | int saved_immediate_echo = current_kboard->immediate_echo; | ||
| 2371 | char *saved_ok_to_echo = ok_to_echo_at_next_pause; | ||
| 2372 | int saved_echo_after_prompt = current_kboard->echo_after_prompt; | ||
| 2373 | |||
| 2374 | if (before_command_restore_flag) | ||
| 2375 | { | ||
| 2376 | this_command_key_count = before_command_key_count_1; | ||
| 2377 | if (this_command_key_count < this_single_command_key_start) | ||
| 2378 | this_single_command_key_start = this_command_key_count; | ||
| 2379 | echo_truncate (before_command_echo_length_1); | ||
| 2380 | before_command_restore_flag = 0; | ||
| 2381 | } | ||
| 2382 | |||
| 2383 | /* Save the this_command_keys status. */ | ||
| 2384 | key_count = this_command_key_count; | ||
| 2385 | |||
| 2386 | if (key_count > 0) | ||
| 2387 | keys = Fcopy_sequence (this_command_keys); | ||
| 2388 | else | ||
| 2389 | keys = Qnil; | ||
| 2371 | GCPRO1 (keys); | 2390 | GCPRO1 (keys); |
| 2391 | |||
| 2392 | /* Clear out this_command_keys. */ | ||
| 2393 | this_command_key_count = 0; | ||
| 2394 | |||
| 2395 | /* Now wipe the echo area. */ | ||
| 2396 | if (echo_area_glyphs) | ||
| 2397 | safe_run_hooks (Qecho_area_clear_hook); | ||
| 2398 | echo_area_glyphs = 0; | ||
| 2399 | echo_truncate (0); | ||
| 2400 | |||
| 2401 | /* Call the input method. */ | ||
| 2372 | tem = call1 (Vinput_method_function, c); | 2402 | tem = call1 (Vinput_method_function, c); |
| 2403 | |||
| 2404 | /* Restore the saved echoing state | ||
| 2405 | and this_command_keys state. */ | ||
| 2406 | this_command_key_count = key_count; | ||
| 2407 | if (key_count > 0) | ||
| 2408 | this_command_keys = keys; | ||
| 2409 | |||
| 2410 | cancel_echoing (); | ||
| 2411 | ok_to_echo_at_next_pause = saved_ok_to_echo; | ||
| 2412 | current_kboard->echo_after_prompt = saved_echo_after_prompt; | ||
| 2413 | if (saved_immediate_echo) | ||
| 2414 | echo_now (); | ||
| 2415 | |||
| 2373 | UNGCPRO; | 2416 | UNGCPRO; |
| 2374 | current_kboard->immediate_echo = saved; | 2417 | |
| 2375 | /* The input method can return no events. */ | 2418 | /* The input method can return no events. */ |
| 2376 | if (! CONSP (tem)) | 2419 | if (! CONSP (tem)) |
| 2377 | { | 2420 | { |
| 2378 | /* Bring back the previous message, if any. */ | 2421 | /* Bring back the previous message, if any. */ |
| 2379 | if (! NILP (Vinput_method_previous_message)) | 2422 | if (! NILP (echo_area_message)) |
| 2380 | message_with_string ("%s", echo_area_message, 0); | 2423 | message_with_string ("%s", echo_area_message, 0); |
| 2381 | this_command_keys = keys; | ||
| 2382 | this_command_key_count = key_count; | ||
| 2383 | cancel_echoing (); | ||
| 2384 | goto retry; | 2424 | goto retry; |
| 2385 | } | 2425 | } |
| 2386 | /* It returned one event or more. */ | 2426 | /* It returned one event or more. */ |
| @@ -8175,6 +8215,7 @@ appears in the echo area and in the value of `this-command-keys.'.") | |||
| 8175 | before_command_restore_flag = 1; | 8215 | before_command_restore_flag = 1; |
| 8176 | before_command_key_count_1 = before_command_key_count; | 8216 | before_command_key_count_1 = before_command_key_count; |
| 8177 | before_command_echo_length_1 = before_command_echo_length; | 8217 | before_command_echo_length_1 = before_command_echo_length; |
| 8218 | return Qnil; | ||
| 8178 | } | 8219 | } |
| 8179 | 8220 | ||
| 8180 | DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0, | 8221 | DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0, |