diff options
| author | Richard M. Stallman | 1996-04-23 20:32:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-04-23 20:32:33 +0000 |
| commit | f854a00b99e42e68070e177f7e2c2b629b2f6bf5 (patch) | |
| tree | b34d6a75b6e17de276a358bc798a0b7707da013a /src/process.c | |
| parent | da3bf069f08f5e7e4af1d97ffe5d93bc36caf8ea (diff) | |
| download | emacs-f854a00b99e42e68070e177f7e2c2b629b2f6bf5.tar.gz emacs-f854a00b99e42e68070e177f7e2c2b629b2f6bf5.zip | |
(wait_reading_process_input, both definitions):
If wait_for_cell, don't call timer_check, and use
detect_input_pending instead of detect_input_pending_run_timers.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index e74e1ed7b56..1637ab6e7db 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2078,11 +2078,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2078 | EMACS_SET_SECS_USECS (timeout, 100000, 0); | 2078 | EMACS_SET_SECS_USECS (timeout, 100000, 0); |
| 2079 | } | 2079 | } |
| 2080 | 2080 | ||
| 2081 | /* If our caller will not immediately handle keyboard events, | 2081 | /* Normally we run timers here. |
| 2082 | run timer events directly. | 2082 | But not if wait_for_cell; in those cases, |
| 2083 | (Callers that will immediately read keyboard events | 2083 | the wait is supposed to be short, |
| 2084 | call timer_delay on their own.) */ | 2084 | and those callers cannot handle running arbitrary Lisp code here. */ |
| 2085 | if (1) | 2085 | if (! wait_for_cell) |
| 2086 | { | 2086 | { |
| 2087 | EMACS_TIME timer_delay; | 2087 | EMACS_TIME timer_delay; |
| 2088 | int old_timers_run; | 2088 | int old_timers_run; |
| @@ -2248,7 +2248,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2248 | /* If there is any, return immediately | 2248 | /* If there is any, return immediately |
| 2249 | to give it higher priority than subprocesses */ | 2249 | to give it higher priority than subprocesses */ |
| 2250 | 2250 | ||
| 2251 | if ((XINT (read_kbd) != 0 || wait_for_cell) | 2251 | if ((XINT (read_kbd) != 0) |
| 2252 | && detect_input_pending_run_timers (do_display)) | 2252 | && detect_input_pending_run_timers (do_display)) |
| 2253 | { | 2253 | { |
| 2254 | swallow_events (do_display); | 2254 | swallow_events (do_display); |
| @@ -2256,6 +2256,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2256 | break; | 2256 | break; |
| 2257 | } | 2257 | } |
| 2258 | 2258 | ||
| 2259 | /* If wait_for_cell. check for keyboard input | ||
| 2260 | but don't run any timers. | ||
| 2261 | ??? (It seems wrong to me to check for keyboard | ||
| 2262 | input at all when wait_for_cell, but the code | ||
| 2263 | has been this way since July 1994. | ||
| 2264 | Try changing this after version 19.31.) */ | ||
| 2265 | if (wait_for_cell | ||
| 2266 | && detect_input_pending ()) | ||
| 2267 | { | ||
| 2268 | swallow_events (do_display); | ||
| 2269 | if (detect_input_pending ()) | ||
| 2270 | break; | ||
| 2271 | } | ||
| 2272 | |||
| 2259 | /* Exit now if the cell we're waiting for became non-nil. */ | 2273 | /* Exit now if the cell we're waiting for became non-nil. */ |
| 2260 | if (wait_for_cell && ! NILP (*wait_for_cell)) | 2274 | if (wait_for_cell && ! NILP (*wait_for_cell)) |
| 2261 | break; | 2275 | break; |
| @@ -3903,7 +3917,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 3903 | run timer events directly. | 3917 | run timer events directly. |
| 3904 | (Callers that will immediately read keyboard events | 3918 | (Callers that will immediately read keyboard events |
| 3905 | call timer_delay on their own.) */ | 3919 | call timer_delay on their own.) */ |
| 3906 | if (1) | 3920 | if (! wait_for_cell) |
| 3907 | { | 3921 | { |
| 3908 | EMACS_TIME timer_delay; | 3922 | EMACS_TIME timer_delay; |
| 3909 | int old_timers_run; | 3923 | int old_timers_run; |
| @@ -3995,7 +4009,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 3995 | 4009 | ||
| 3996 | /* Check for keyboard input */ | 4010 | /* Check for keyboard input */ |
| 3997 | 4011 | ||
| 3998 | if ((XINT (read_kbd) != 0 || wait_for_cell) | 4012 | if ((XINT (read_kbd) != 0) |
| 3999 | && detect_input_pending_run_timers (do_display)) | 4013 | && detect_input_pending_run_timers (do_display)) |
| 4000 | { | 4014 | { |
| 4001 | swallow_events (do_display); | 4015 | swallow_events (do_display); |
| @@ -4003,6 +4017,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4003 | break; | 4017 | break; |
| 4004 | } | 4018 | } |
| 4005 | 4019 | ||
| 4020 | /* If wait_for_cell. check for keyboard input | ||
| 4021 | but don't run any timers. | ||
| 4022 | ??? (It seems wrong to me to check for keyboard | ||
| 4023 | input at all when wait_for_cell, but the code | ||
| 4024 | has been this way since July 1994. | ||
| 4025 | Try changing this after version 19.31.) */ | ||
| 4026 | if (wait_for_cell | ||
| 4027 | && detect_input_pending ()) | ||
| 4028 | { | ||
| 4029 | swallow_events (do_display); | ||
| 4030 | if (detect_input_pending ()) | ||
| 4031 | break; | ||
| 4032 | } | ||
| 4033 | |||
| 4006 | /* Exit now if the cell we're waiting for became non-nil. */ | 4034 | /* Exit now if the cell we're waiting for became non-nil. */ |
| 4007 | if (wait_for_cell && ! NILP (*wait_for_cell)) | 4035 | if (wait_for_cell && ! NILP (*wait_for_cell)) |
| 4008 | break; | 4036 | break; |