summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-01-29 04:50:16 +0000
committerRichard M. Stallman <rms@gnu.org>1996-01-29 04:50:16 +0000
commitf326ab173fbe7483f9be06a6bca1e4de139b48fd (patch)
tree02be526a326bc4372661ba5d9abd4aa60bb6d1b7 /src
parenta3f7b59d4d6ed96b10ad970317b10dae22089406 (diff)
downloademacs-f326ab173fbe7483f9be06a6bca1e4de139b48fd.tar.gz
(wait_reading_process_input): Call timer_check
and shorten the inner delay if appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/process.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index c68309432b5..2dd1a46c32d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -249,6 +249,8 @@ int proc_buffered_char[MAXDESC];
static Lisp_Object get_process ();
+extern EMACS_TIME timer_check ();
+
/* Maximum number of bytes to send to a pty without an eof. */
static int pty_max_bytes;
@@ -2053,6 +2055,22 @@ 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 (read_kbd >= 0)
+ {
+ EMACS_TIME timer_delay = timer_check (1);
+ if (! EMACS_TIME_NEG_P (timer_delay))
+ {
+ EMACS_TIME difference;
+ EMACS_SUB_TIME (difference, timer_delay, timeout);
+ if (EMACS_TIME_NEG_P (difference))
+ timeout = timer_delay;
+ }
+ }
+
/* Cause C-g and alarm signals to take immediate action,
and cause input available signals to zero out timeout.