diff options
| author | Gerd Moellmann | 1999-08-21 19:29:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-08-21 19:29:53 +0000 |
| commit | 985f9f6642aa4db5649425c2b53d31f34c0e425c (patch) | |
| tree | bcc028011e0e49885caedcbdccaef4999b36994b /src | |
| parent | 4f13cc9959c1a786da94bbb1fef1a633619e3066 (diff) | |
| download | emacs-985f9f6642aa4db5649425c2b53d31f34c0e425c.tar.gz emacs-985f9f6642aa4db5649425c2b53d31f34c0e425c.zip | |
Call change_frame_size and do_pending_window_change with
new parameter.
(ok_to_echo_at_next_pause): Make it a pointer to
a struct kboard.
(echo_kboard): New.
(echo_now): Set echo_kboard to the current kboard.
(cancel_echoing): Set echo_kboard to null.
(cmd_error_internal): Use clear_message, remove references
to echo_area_glyphs and echo_area_message.
(command_loop_1): Check for echo area messages differently.
(read_char): Likewise.
(record_menu_key): Use clear_message.
(Fexecute_extended_command): Check for echo area messages
differently. Use push_message, restore_message, pop_message.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 53517e377c9..bfab331eba7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -184,11 +184,20 @@ static jmp_buf getcjmp; | |||
| 184 | int waiting_for_input; | 184 | int waiting_for_input; |
| 185 | 185 | ||
| 186 | /* True while displaying for echoing. Delays C-g throwing. */ | 186 | /* True while displaying for echoing. Delays C-g throwing. */ |
| 187 | |||
| 187 | static int echoing; | 188 | static int echoing; |
| 188 | 189 | ||
| 189 | /* True means we can start echoing at the next input pause | 190 | /* Non-null means we can start echoing at the next input pause even |
| 190 | even though there is something in the echo area. */ | 191 | though there is something in the echo area. */ |
| 191 | static char *ok_to_echo_at_next_pause; | 192 | |
| 193 | static struct kboard *ok_to_echo_at_next_pause; | ||
| 194 | |||
| 195 | /* The kboard currently echoing, or null for none. Set in echo_now to | ||
| 196 | the kboard echoing. Reset to 0 in cancel_echoing. If non-null, | ||
| 197 | and a current echo area message exists, we know that it comes from | ||
| 198 | echoing. */ | ||
| 199 | |||
| 200 | static struct kboard *echo_kboard; | ||
| 192 | 201 | ||
| 193 | /* Nonzero means disregard local maps for the menu bar. */ | 202 | /* Nonzero means disregard local maps for the menu bar. */ |
| 194 | static int inhibit_local_menu_bar_menus; | 203 | static int inhibit_local_menu_bar_menus; |
| @@ -738,9 +747,9 @@ echo_now () | |||
| 738 | } | 747 | } |
| 739 | 748 | ||
| 740 | echoing = 1; | 749 | echoing = 1; |
| 750 | echo_kboard = current_kboard; | ||
| 741 | message2_nolog (current_kboard->echobuf, strlen (current_kboard->echobuf), | 751 | message2_nolog (current_kboard->echobuf, strlen (current_kboard->echobuf), |
| 742 | ! NILP (current_buffer->enable_multibyte_characters)); | 752 | ! NILP (current_buffer->enable_multibyte_characters)); |
| 743 | |||
| 744 | echoing = 0; | 753 | echoing = 0; |
| 745 | 754 | ||
| 746 | if (waiting_for_input && !NILP (Vquit_flag)) | 755 | if (waiting_for_input && !NILP (Vquit_flag)) |
| @@ -756,6 +765,7 @@ cancel_echoing () | |||
| 756 | current_kboard->echoptr = current_kboard->echobuf; | 765 | current_kboard->echoptr = current_kboard->echobuf; |
| 757 | current_kboard->echo_after_prompt = -1; | 766 | current_kboard->echo_after_prompt = -1; |
| 758 | ok_to_echo_at_next_pause = 0; | 767 | ok_to_echo_at_next_pause = 0; |
| 768 | echo_kboard = 0; | ||
| 759 | } | 769 | } |
| 760 | 770 | ||
| 761 | /* Return the length of the current echo string. */ | 771 | /* Return the length of the current echo string. */ |
| @@ -1025,8 +1035,7 @@ cmd_error_internal (data, context) | |||
| 1025 | 1035 | ||
| 1026 | Vquit_flag = Qnil; | 1036 | Vquit_flag = Qnil; |
| 1027 | Vinhibit_quit = Qt; | 1037 | Vinhibit_quit = Qt; |
| 1028 | echo_area_glyphs = 0; | 1038 | clear_message (1, 0); |
| 1029 | echo_area_message = Qnil; | ||
| 1030 | 1039 | ||
| 1031 | /* If the window system or terminal frame hasn't been initialized | 1040 | /* If the window system or terminal frame hasn't been initialized |
| 1032 | yet, or we're not interactive, it's best to dump this message out | 1041 | yet, or we're not interactive, it's best to dump this message out |
| @@ -1239,7 +1248,7 @@ command_loop_1 () | |||
| 1239 | wait 2 sec and redraw minibuffer. */ | 1248 | wait 2 sec and redraw minibuffer. */ |
| 1240 | 1249 | ||
| 1241 | if (minibuf_level | 1250 | if (minibuf_level |
| 1242 | && (echo_area_glyphs || STRINGP (echo_area_message)) | 1251 | && !NILP (echo_area_buffer[0]) |
| 1243 | && EQ (minibuf_window, echo_area_window)) | 1252 | && EQ (minibuf_window, echo_area_window)) |
| 1244 | { | 1253 | { |
| 1245 | /* Bind inhibit-quit to t so that C-g gets read in | 1254 | /* Bind inhibit-quit to t so that C-g gets read in |
| @@ -1950,12 +1959,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1950 | } | 1959 | } |
| 1951 | 1960 | ||
| 1952 | /* Message turns off echoing unless more keystrokes turn it on again. */ | 1961 | /* Message turns off echoing unless more keystrokes turn it on again. */ |
| 1953 | if (echo_area_glyphs | 1962 | if (/* There is a current message. */ |
| 1954 | && *echo_area_glyphs | 1963 | !NILP (echo_area_buffer[0]) |
| 1955 | && echo_area_glyphs != current_kboard->echobuf | 1964 | /* And we're not echoing from this kboard. */ |
| 1956 | && ok_to_echo_at_next_pause != echo_area_glyphs) | 1965 | && echo_kboard != current_kboard |
| 1957 | cancel_echoing (); | 1966 | /* And it's either not ok to echo (ok_to_echo == NULL), or the |
| 1958 | else if (STRINGP (echo_area_message)) | 1967 | last char echoed was from a different kboard. */ |
| 1968 | && ok_to_echo_at_next_pause != echo_kboard) | ||
| 1959 | cancel_echoing (); | 1969 | cancel_echoing (); |
| 1960 | else | 1970 | else |
| 1961 | /* If already echoing, continue. */ | 1971 | /* If already echoing, continue. */ |
| @@ -2034,12 +2044,18 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2034 | && this_command_key_count > 0 | 2044 | && this_command_key_count > 0 |
| 2035 | && ! noninteractive | 2045 | && ! noninteractive |
| 2036 | && echo_keystrokes > 0 | 2046 | && echo_keystrokes > 0 |
| 2037 | && !STRINGP (echo_area_message) | 2047 | && (/* No message. */ |
| 2038 | && (echo_area_glyphs == 0 || *echo_area_glyphs == 0 | 2048 | NILP (echo_area_buffer[0]) |
| 2039 | || ok_to_echo_at_next_pause == echo_area_glyphs)) | 2049 | /* Or empty message. */ |
| 2050 | || (BUF_BEG (XBUFFER (echo_area_buffer[0])) | ||
| 2051 | == BUF_Z (XBUFFER (echo_area_buffer[0]))) | ||
| 2052 | /* Or already echoing from same kboard. */ | ||
| 2053 | || (echo_kboard && ok_to_echo_at_next_pause == echo_kboard) | ||
| 2054 | /* Or not echoing before and echoing allowed. */ | ||
| 2055 | || (!echo_kboard && ok_to_echo_at_next_pause))) | ||
| 2040 | { | 2056 | { |
| 2041 | Lisp_Object tem0; | 2057 | Lisp_Object tem0; |
| 2042 | 2058 | ||
| 2043 | /* After a mouse event, start echoing right away. | 2059 | /* After a mouse event, start echoing right away. |
| 2044 | This is because we are probably about to display a menu, | 2060 | This is because we are probably about to display a menu, |
| 2045 | and we don't want to delay before doing so. */ | 2061 | and we don't want to delay before doing so. */ |
| @@ -2361,10 +2377,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2361 | } | 2377 | } |
| 2362 | 2378 | ||
| 2363 | /* Now wipe the echo area. */ | 2379 | /* Now wipe the echo area. */ |
| 2364 | if (echo_area_glyphs || STRINGP (echo_area_message)) | 2380 | if (!NILP (echo_area_buffer[0])) |
| 2365 | safe_run_hooks (Qecho_area_clear_hook); | 2381 | safe_run_hooks (Qecho_area_clear_hook); |
| 2366 | echo_area_glyphs = 0; | 2382 | clear_message (1, 0); |
| 2367 | echo_area_message = Qnil; | ||
| 2368 | 2383 | ||
| 2369 | reread_for_input_method: | 2384 | reread_for_input_method: |
| 2370 | from_macro: | 2385 | from_macro: |
| @@ -2384,7 +2399,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2384 | 2399 | ||
| 2385 | /* Save the echo status. */ | 2400 | /* Save the echo status. */ |
| 2386 | int saved_immediate_echo = current_kboard->immediate_echo; | 2401 | int saved_immediate_echo = current_kboard->immediate_echo; |
| 2387 | char *saved_ok_to_echo = ok_to_echo_at_next_pause; | 2402 | struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; |
| 2388 | int saved_echo_after_prompt = current_kboard->echo_after_prompt; | 2403 | int saved_echo_after_prompt = current_kboard->echo_after_prompt; |
| 2389 | 2404 | ||
| 2390 | if (before_command_restore_flag) | 2405 | if (before_command_restore_flag) |
| @@ -2409,10 +2424,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2409 | this_command_key_count = 0; | 2424 | this_command_key_count = 0; |
| 2410 | 2425 | ||
| 2411 | /* Now wipe the echo area. */ | 2426 | /* Now wipe the echo area. */ |
| 2412 | if (echo_area_glyphs || STRINGP (echo_area_message)) | 2427 | if (!NILP (echo_area_buffer[0])) |
| 2413 | safe_run_hooks (Qecho_area_clear_hook); | 2428 | safe_run_hooks (Qecho_area_clear_hook); |
| 2414 | echo_area_glyphs = 0; | 2429 | clear_message (1, 0); |
| 2415 | echo_area_message = Qnil; | ||
| 2416 | echo_truncate (0); | 2430 | echo_truncate (0); |
| 2417 | 2431 | ||
| 2418 | /* If we are not reading a key sequence, | 2432 | /* If we are not reading a key sequence, |
| @@ -2491,7 +2505,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2491 | echo_char (also_record); | 2505 | echo_char (also_record); |
| 2492 | /* Once we reread a character, echoing can happen | 2506 | /* Once we reread a character, echoing can happen |
| 2493 | the next time we pause to read a new one. */ | 2507 | the next time we pause to read a new one. */ |
| 2494 | ok_to_echo_at_next_pause = echo_area_glyphs; | 2508 | ok_to_echo_at_next_pause = current_kboard; |
| 2495 | } | 2509 | } |
| 2496 | 2510 | ||
| 2497 | /* Record this character as part of the current key. */ | 2511 | /* Record this character as part of the current key. */ |
| @@ -2544,8 +2558,7 @@ record_menu_key (c) | |||
| 2544 | Lisp_Object c; | 2558 | Lisp_Object c; |
| 2545 | { | 2559 | { |
| 2546 | /* Wipe the echo area. */ | 2560 | /* Wipe the echo area. */ |
| 2547 | echo_area_glyphs = 0; | 2561 | clear_message (1, 0); |
| 2548 | echo_area_message = Qnil; | ||
| 2549 | 2562 | ||
| 2550 | record_char (c); | 2563 | record_char (c); |
| 2551 | 2564 | ||
| @@ -8643,7 +8656,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 8643 | { | 8656 | { |
| 8644 | /* But first wait, and skip the message if there is input. */ | 8657 | /* But first wait, and skip the message if there is input. */ |
| 8645 | int delay_time; | 8658 | int delay_time; |
| 8646 | if (echo_area_glyphs != 0 || STRINGP (echo_area_message)) | 8659 | if (!NILP (echo_area_buffer[0])) |
| 8647 | /* This command displayed something in the echo area; | 8660 | /* This command displayed something in the echo area; |
| 8648 | so wait a few seconds, then display our suggestion message. */ | 8661 | so wait a few seconds, then display our suggestion message. */ |
| 8649 | delay_time = (NUMBERP (Vsuggest_key_bindings) | 8662 | delay_time = (NUMBERP (Vsuggest_key_bindings) |
| @@ -8658,10 +8671,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 8658 | { | 8671 | { |
| 8659 | Lisp_Object binding; | 8672 | Lisp_Object binding; |
| 8660 | char *newmessage; | 8673 | char *newmessage; |
| 8661 | char *oldmessage = echo_area_glyphs; | 8674 | int message_p = push_message (); |
| 8662 | Lisp_Object oldmessage_string = echo_area_message; | ||
| 8663 | int oldmessage_len = echo_area_glyphs_length; | ||
| 8664 | int oldmultibyte = message_enable_multibyte; | ||
| 8665 | 8675 | ||
| 8666 | binding = Fkey_description (bindings); | 8676 | binding = Fkey_description (bindings); |
| 8667 | 8677 | ||
| @@ -8677,14 +8687,11 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 8677 | STRING_MULTIBYTE (binding)); | 8687 | STRING_MULTIBYTE (binding)); |
| 8678 | if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings) | 8688 | if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings) |
| 8679 | ? Vsuggest_key_bindings : make_number (2)), | 8689 | ? Vsuggest_key_bindings : make_number (2)), |
| 8680 | Qnil, Qnil))) | 8690 | Qnil, Qnil)) |
| 8681 | { | 8691 | && message_p) |
| 8682 | if (STRINGP (oldmessage_string)) | 8692 | restore_message (); |
| 8683 | message3_nolog (oldmessage_string, oldmessage_len, | 8693 | |
| 8684 | oldmultibyte); | 8694 | pop_message (); |
| 8685 | else | ||
| 8686 | message2_nolog (oldmessage, oldmessage_len, oldmultibyte); | ||
| 8687 | } | ||
| 8688 | } | 8695 | } |
| 8689 | } | 8696 | } |
| 8690 | 8697 | ||
| @@ -8997,7 +9004,7 @@ On such systems, Emacs starts a subshell instead of suspending.") | |||
| 8997 | with a window system; but suspend should be disabled in that case. */ | 9004 | with a window system; but suspend should be disabled in that case. */ |
| 8998 | get_frame_size (&width, &height); | 9005 | get_frame_size (&width, &height); |
| 8999 | if (width != old_width || height != old_height) | 9006 | if (width != old_width || height != old_height) |
| 9000 | change_frame_size (selected_frame, height, width, 0, 0); | 9007 | change_frame_size (selected_frame, height, width, 0, 0, 0); |
| 9001 | 9008 | ||
| 9002 | /* Run suspend-resume-hook. */ | 9009 | /* Run suspend-resume-hook. */ |
| 9003 | if (!NILP (Vrun_hooks)) | 9010 | if (!NILP (Vrun_hooks)) |