diff options
| author | Richard M. Stallman | 1997-06-29 00:34:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-29 00:34:36 +0000 |
| commit | 0c9960e9f5ee5d7fdf801d82016b769bf50ddaa5 (patch) | |
| tree | e5bffdea87cf660c81c716ba42126289c2c4c46f | |
| parent | 4c9206330167bcbc353eb066e3fc81b97d698097 (diff) | |
| download | emacs-0c9960e9f5ee5d7fdf801d82016b769bf50ddaa5.tar.gz emacs-0c9960e9f5ee5d7fdf801d82016b769bf50ddaa5.zip | |
(wait_reading_process_input): If wait_for_cell,
do check for keyboard input and swallow events, just don't exit.
(max): New macro.
(wait_reading_process_input): Pass a smaller first arg to select.
| -rw-r--r-- | src/process.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index c51d862969b..f8a8445e764 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -107,6 +107,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 107 | #include "frame.h" | 107 | #include "frame.h" |
| 108 | #include "blockinput.h" | 108 | #include "blockinput.h" |
| 109 | 109 | ||
| 110 | #define max(a, b) ((a) > (b) ? (a) : (b)) | ||
| 111 | |||
| 110 | Lisp_Object Qprocessp; | 112 | Lisp_Object Qprocessp; |
| 111 | Lisp_Object Qrun, Qstop, Qsignal, Qopen, Qclosed; | 113 | Lisp_Object Qrun, Qstop, Qsignal, Qopen, Qclosed; |
| 112 | Lisp_Object Qlast_nonmenu_event; | 114 | Lisp_Object Qlast_nonmenu_event; |
| @@ -2288,7 +2290,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2288 | { | 2290 | { |
| 2289 | Atemp = input_wait_mask; | 2291 | Atemp = input_wait_mask; |
| 2290 | EMACS_SET_SECS_USECS (timeout, 0, 0); | 2292 | EMACS_SET_SECS_USECS (timeout, 0, 0); |
| 2291 | if ((select (MAXDESC, &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | 2293 | if ((select (max (max_process_desc, max_keyboard_desc) + 1, |
| 2294 | &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | ||
| 2292 | &timeout) | 2295 | &timeout) |
| 2293 | <= 0)) | 2296 | <= 0)) |
| 2294 | { | 2297 | { |
| @@ -2349,7 +2352,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2349 | FD_ZERO (&Available); | 2352 | FD_ZERO (&Available); |
| 2350 | } | 2353 | } |
| 2351 | else | 2354 | else |
| 2352 | nfds = select (MAXDESC, &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | 2355 | nfds = select (max (max_process_desc, max_keyboard_desc) + 1, |
| 2356 | &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | ||
| 2353 | &timeout); | 2357 | &timeout); |
| 2354 | 2358 | ||
| 2355 | xerrno = errno; | 2359 | xerrno = errno; |
| @@ -2445,21 +2449,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2445 | && requeued_events_pending_p ()) | 2449 | && requeued_events_pending_p ()) |
| 2446 | break; | 2450 | break; |
| 2447 | 2451 | ||
| 2448 | #if 0 | ||
| 2449 | /* If wait_for_cell. check for keyboard input | 2452 | /* If wait_for_cell. check for keyboard input |
| 2450 | but don't run any timers. | 2453 | but don't run any timers. |
| 2451 | ??? (It seems wrong to me to check for keyboard | 2454 | The reason for this is so that X events will be processed. |
| 2452 | input at all when wait_for_cell, but the code | 2455 | Otherwise they may have to wait until polling takes place. |
| 2453 | has been this way since July 1994. | 2456 | That would causes delays in pasting selections, for example. */ |
| 2454 | Try changing this after version 19.31.) */ | ||
| 2455 | if (wait_for_cell | 2457 | if (wait_for_cell |
| 2456 | && detect_input_pending ()) | 2458 | && detect_input_pending ()) |
| 2457 | { | 2459 | { |
| 2458 | swallow_events (do_display); | 2460 | swallow_events (do_display); |
| 2461 | #if 0 /* Exiting when read_kbd doesn't request that seems wrong, though. */ | ||
| 2459 | if (detect_input_pending ()) | 2462 | if (detect_input_pending ()) |
| 2460 | break; | 2463 | break; |
| 2461 | } | ||
| 2462 | #endif | 2464 | #endif |
| 2465 | } | ||
| 2463 | 2466 | ||
| 2464 | /* Exit now if the cell we're waiting for became non-nil. */ | 2467 | /* Exit now if the cell we're waiting for became non-nil. */ |
| 2465 | if (wait_for_cell && ! NILP (*wait_for_cell)) | 2468 | if (wait_for_cell && ! NILP (*wait_for_cell)) |