Mercurial > emacs
comparison src/dispnew.c @ 71333:a8cbcce39bd0
(sit_for): Undo 2006-06-01 change. Instead, a
negative time forces redisplay even when input is available.
(Fsit_for): Doc fix.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 13 Jun 2006 22:06:22 +0000 |
parents | e882f189c3af |
children | 1b442e9d8373 |
comparison
equal
deleted
inserted
replaced
71332:09e601998e13 | 71333:a8cbcce39bd0 |
---|---|
6493 | 6493 |
6494 Lisp_Object | 6494 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; |
6510 | 6517 |
6511 #ifdef SIGIO | 6518 #ifdef SIGIO |
6527 Optional arg NODISP non-nil means don't redisplay, just wait for input. | 6534 Optional arg NODISP non-nil means don't redisplay, just wait for input. |
6528 Redisplay is preempted as always if input arrives, and does not happen | 6535 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) |
6537 Where the optional arg MILLISECONDS specifies an additional wait period, | 6543 Where the optional arg MILLISECONDS specifies an additional wait period, |
6538 in milliseconds; this was useful when Emacs was built without | 6544 in milliseconds; this was useful when Emacs was built without |