From: Kim F. Storm Date: Tue, 13 Jun 2006 22:06:22 +0000 (+0000) Subject: (sit_for): Undo 2006-06-01 change. Instead, a X-Git-Tag: emacs-pretest-22.0.90~1971 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f222369e0aa7afbea32c037c40eb84da809744f2;p=emacs.git (sit_for): Undo 2006-06-01 change. Instead, a negative time forces redisplay even when input is available. (Fsit_for): Doc fix. --- 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 sit_for (sec, usec, reading, display, initial_display) int sec, usec, reading, display, initial_display; { + int preempt = (sec >= 0) || (sec == 0 && usec >= 0); + swallow_events (display); - if ((detect_input_pending_run_timers (display) - && !redisplay_dont_pause) + if ((detect_input_pending_run_timers (display) && preempt) || !NILP (Vexecuting_kbd_macro)) return Qnil; if (initial_display) - redisplay_preserve_echo_area (2); + { + int count = SPECPDL_INDEX (); + if (!preempt) + specbind (Qredisplay_dont_pause, Qt); + redisplay_preserve_echo_area (2); + unbind_to (count, Qnil); + } if (sec == 0 && usec == 0) return Qt; @@ -6529,8 +6536,7 @@ Redisplay is preempted as always if input arrives, and does not happen if input is available before it starts. Value is t if waited the full time with no input arriving. -Redisplay will occur even when input is available if you bind -`redisplay-dont-pause' to a non-nil value. +Redisplay will occur even when input is available if SECONDS is negative. An obsolete but still supported form is \(sit-for SECONDS &optional MILLISECONDS NODISP)