changeset 10827:4dfd3634b155

(unlock_display): New function. (cmd_error, command_loop_1): Call it when appropriate. (read_char): If no current display, don't try to echo.
author Karl Heuer <kwzh@gnu.org>
date Sat, 25 Feb 1995 07:13:09 +0000
parents bd0ab0601489
children 0ecc478ed305
files src/keyboard.c
diffstat 1 files changed, 30 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sat Feb 25 04:57:17 1995 +0000
+++ b/src/keyboard.c	Sat Feb 25 07:13:09 1995 +0000
@@ -733,6 +733,19 @@
   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 @@
 
   Vinhibit_quit = Qnil;
 #ifdef MULTI_PERDISPLAY
-  current_perdisplay = 0;
-  display_locked = 0;
+  unlock_display ();
 #endif
 
   return make_number (0);
@@ -951,7 +963,7 @@
   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 @@
 	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 @@
       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 @@
 
   /* 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