]> git.eshelyaron.com Git - emacs.git/commitdiff
(wait_reading_process_input, both definitions):
authorRichard M. Stallman <rms@gnu.org>
Tue, 23 Apr 1996 20:32:33 +0000 (20:32 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 23 Apr 1996 20:32:33 +0000 (20:32 +0000)
If wait_for_cell, don't call timer_check, and use
detect_input_pending instead of detect_input_pending_run_timers.

src/process.c

index e74e1ed7b5641ef261d8ce11e3e514bc72ccce43..1637ab6e7dbd3b29629d5d53de034fddc4795ddc 100644 (file)
@@ -2078,11 +2078,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
          EMACS_SET_SECS_USECS (timeout, 100000, 0);
        }
 
-      /* If our caller will not immediately handle keyboard events,
-        run timer events directly.
-        (Callers that will immediately read keyboard events
-        call timer_delay on their own.)  */
-      if (1)
+      /* Normally we run timers here.
+        But not if wait_for_cell; in those cases,
+        the wait is supposed to be short,
+        and those callers cannot handle running arbitrary Lisp code here.  */
+      if (! wait_for_cell)
        {
          EMACS_TIME timer_delay;
          int old_timers_run;
@@ -2248,7 +2248,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
       /* If there is any, return immediately
         to give it higher priority than subprocesses */
 
-      if ((XINT (read_kbd) != 0 || wait_for_cell)
+      if ((XINT (read_kbd) != 0)
          && detect_input_pending_run_timers (do_display))
        {
          swallow_events (do_display);
@@ -2256,6 +2256,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
            break;
        }
 
+      /* If wait_for_cell. check for keyboard input
+        but don't run any timers.
+        ??? (It seems wrong to me to check for keyboard
+        input at all when wait_for_cell, but the code
+        has been this way since July 1994.
+        Try changing this after version 19.31.)  */
+      if (wait_for_cell
+         && detect_input_pending ())
+       {
+         swallow_events (do_display);
+         if (detect_input_pending ())
+           break;
+       }
+
       /* Exit now if the cell we're waiting for became non-nil.  */
       if (wait_for_cell && ! NILP (*wait_for_cell))
        break;
@@ -3903,7 +3917,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
         run timer events directly.
         (Callers that will immediately read keyboard events
         call timer_delay on their own.)  */
-      if (1)
+      if (! wait_for_cell)
        {
          EMACS_TIME timer_delay;
          int old_timers_run;
@@ -3995,7 +4009,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
 
       /* Check for keyboard input */
 
-      if ((XINT (read_kbd) != 0 || wait_for_cell)
+      if ((XINT (read_kbd) != 0)
          && detect_input_pending_run_timers (do_display))
        {
          swallow_events (do_display);
@@ -4003,6 +4017,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
            break;
        }
 
+      /* If wait_for_cell. check for keyboard input
+        but don't run any timers.
+        ??? (It seems wrong to me to check for keyboard
+        input at all when wait_for_cell, but the code
+        has been this way since July 1994.
+        Try changing this after version 19.31.)  */
+      if (wait_for_cell
+         && detect_input_pending ())
+       {
+         swallow_events (do_display);
+         if (detect_input_pending ())
+           break;
+       }
+
       /* Exit now if the cell we're waiting for became non-nil.  */
       if (wait_for_cell && ! NILP (*wait_for_cell))
        break;