diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index e205105536c..43f86a32f4c 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6495,15 +6495,22 @@ Lisp_Object | |||
| 6495 | sit_for (sec, usec, reading, display, initial_display) | 6495 | sit_for (sec, usec, reading, display, initial_display) |
| 6496 | int sec, usec, reading, display, initial_display; | 6496 | int sec, usec, reading, display, initial_display; |
| 6497 | { | 6497 | { |
| 6498 | int preempt = (sec >= 0) || (sec == 0 && usec >= 0); | ||
| 6499 | |||
| 6498 | swallow_events (display); | 6500 | swallow_events (display); |
| 6499 | 6501 | ||
| 6500 | if ((detect_input_pending_run_timers (display) | 6502 | if ((detect_input_pending_run_timers (display) && preempt) |
| 6501 | && !redisplay_dont_pause) | ||
| 6502 | || !NILP (Vexecuting_kbd_macro)) | 6503 | || !NILP (Vexecuting_kbd_macro)) |
| 6503 | return Qnil; | 6504 | return Qnil; |
| 6504 | 6505 | ||
| 6505 | if (initial_display) | 6506 | if (initial_display) |
| 6506 | redisplay_preserve_echo_area (2); | 6507 | { |
| 6508 | int count = SPECPDL_INDEX (); | ||
| 6509 | if (!preempt) | ||
| 6510 | specbind (Qredisplay_dont_pause, Qt); | ||
| 6511 | redisplay_preserve_echo_area (2); | ||
| 6512 | unbind_to (count, Qnil); | ||
| 6513 | } | ||
| 6507 | 6514 | ||
| 6508 | if (sec == 0 && usec == 0) | 6515 | if (sec == 0 && usec == 0) |
| 6509 | return Qt; | 6516 | return Qt; |
| @@ -6529,8 +6536,7 @@ Redisplay is preempted as always if input arrives, and does not happen | |||
| 6529 | if input is available before it starts. | 6536 | if input is available before it starts. |
| 6530 | Value is t if waited the full time with no input arriving. | 6537 | Value is t if waited the full time with no input arriving. |
| 6531 | 6538 | ||
| 6532 | Redisplay will occur even when input is available if you bind | 6539 | Redisplay will occur even when input is available if SECONDS is negative. |
| 6533 | `redisplay-dont-pause' to a non-nil value. | ||
| 6534 | 6540 | ||
| 6535 | An obsolete but still supported form is | 6541 | An obsolete but still supported form is |
| 6536 | \(sit-for SECONDS &optional MILLISECONDS NODISP) | 6542 | \(sit-for SECONDS &optional MILLISECONDS NODISP) |