changeset 18231:7f3969697013

(kbd_buffer_get_event): When wait_reading_process_input returns, check Vunread_command_events.
author Richard M. Stallman <rms@gnu.org>
date Fri, 13 Jun 1997 00:46:33 +0000
parents 2f1f942f25ca
children 4183933733e6
files src/keyboard.c
diffstat 1 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Jun 13 00:45:19 1997 +0000
+++ b/src/keyboard.c	Fri Jun 13 00:46:33 1997 +0000
@@ -1885,7 +1885,8 @@
 	  restore_getcjmp (local_getcjmp);
 	  tem0 = sit_for (echo_keystrokes, 0, 1, 1, 0);
 	  restore_getcjmp (save_jump);
-	  if (EQ (tem0, Qt))
+	  if (EQ (tem0, Qt)
+	      && ! CONSP (Vunread_command_events))
 	    echo_now ();
 	}
     }
@@ -1955,7 +1956,8 @@
 			  0, 1, 1, 0);
 	  restore_getcjmp (save_jump);
 
-	  if (EQ (tem0, Qt))
+	  if (EQ (tem0, Qt)
+	      && ! CONSP (Vunread_command_events))
 	    {
 	      Fdo_auto_save (Qnil, Qnil);
 
@@ -1971,6 +1973,14 @@
 	}
     }
 
+  /* If this has become non-nil here, it has been set by a timer
+     or sentinel or filter.  */
+  if (CONSP (Vunread_command_events))
+    {
+      c = XCONS (Vunread_command_events)->car;
+      Vunread_command_events = XCONS (Vunread_command_events)->cdr;
+    }
+
   /* Read something from current KBOARD's side queue, if possible.  */
 
   if (NILP (c))
@@ -2668,6 +2678,15 @@
 #endif /* not VMS */
     }
 
+  if (CONSP (Vunread_command_events))
+    {
+      Lisp_Object first;
+      first = XCONS (Vunread_command_events)->car;
+      Vunread_command_events = XCONS (Vunread_command_events)->cdr;
+      *kbp = current_kboard;
+      return first;
+    }
+
   /* At this point, we know that there is a readable event available
      somewhere.  If the event queue is empty, then there must be a
      mouse movement enabled and available.  */
@@ -7092,7 +7111,8 @@
       /* But first wait, and skip the message if there is input.  */
       if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings)
 			    ? Vsuggest_key_bindings : make_number (2)),
-			   Qnil, Qnil)))
+			   Qnil, Qnil))
+	  && ! CONSP (Vunread_command_events))
 	{
 	  Lisp_Object binding;
 	  char *newmessage;