From 604ccd1d31a056d5c6f33bf846377a14567bf367 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sat, 25 Feb 1995 07:13:09 +0000 Subject: [PATCH] (unlock_display): New function. (cmd_error, command_loop_1): Call it when appropriate. (read_char): If no current display, don't try to echo. --- src/keyboard.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 56800409d6b..c2f8d88553b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -733,6 +733,19 @@ recursive_edit_unwind (buffer) return Qnil; } +#ifdef MULTI_PERDISPLAY +static void +unlock_display () +{ + if (CONSP (Vunread_command_events)) + current_perdisplay->kbd_queue + = nconc2 (Vunread_command_events, current_perdisplay->kbd_queue); + Vunread_command_events = Qnil; + current_perdisplay = 0; + display_locked = 0; +} +#endif + Lisp_Object cmd_error (data) Lisp_Object data; @@ -750,8 +763,7 @@ cmd_error (data) Vinhibit_quit = Qnil; #ifdef MULTI_PERDISPLAY - current_perdisplay = 0; - display_locked = 0; + unlock_display (); #endif return make_number (0); @@ -951,7 +963,7 @@ command_loop_1 () int prev_modiff; struct buffer *prev_buffer; #ifdef MULTI_PERDISPLAY - PERDISPLAY *outer_perdisplay = current_perdisplay; + int was_locked = display_locked; #endif Vdeactivate_mark = Qnil; @@ -1275,8 +1287,8 @@ command_loop_1 () finalize_kbd_macro_chars (); #ifdef MULTI_PERDISPLAY - current_perdisplay = outer_perdisplay; - display_locked = (current_perdisplay != 0); + if (!was_locked) + unlock_display (); #endif } } @@ -1600,13 +1612,16 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) goto non_reread; } - /* Message turns off echoing unless more keystrokes turn it on again. */ - if (echo_area_glyphs && *echo_area_glyphs - && echo_area_glyphs != current_perdisplay->echobuf) - cancel_echoing (); - else - /* If already echoing, continue. */ - echo_dash (); + if (current_perdisplay) + { + /* Message turns off echoing unless more keystrokes turn it on again. */ + if (echo_area_glyphs && *echo_area_glyphs + && echo_area_glyphs != current_perdisplay->echobuf) + cancel_echoing (); + else + /* If already echoing, continue. */ + echo_dash (); + } /* Try reading a character via menu prompting in the minibuf. Try this before the sit-for, because the sit-for @@ -1631,7 +1646,9 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) /* If in middle of key sequence and minibuffer not active, start echoing if enough time elapses. */ - if (minibuf_level == 0 && !current_perdisplay->immediate_echo + if (current_perdisplay + && minibuf_level == 0 + && !current_perdisplay->immediate_echo && this_command_key_count > 0 && ! noninteractive && echo_keystrokes > 0 -- 2.39.5