+2006-07-17 Chong Yidong <cyd@stupidchicken.com>
+
+ * subr.el (sit-for): Just sleep-for if noninteractive.
+
2006-07-17 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/autoload.el (make-autoload): Use new arg.
(when (or obsolete (numberp nodisp))
(setq seconds (+ seconds (* 1e-3 nodisp)))
(setq nodisp obsolete))
- (unless nodisp
- (redisplay))
- (or (<= seconds 0)
- (let ((timer (timer-create))
- (echo-keystrokes 0))
- (if (catch 'sit-for-timeout
- (timer-set-time timer (timer-relative-time
- (current-time) seconds))
- (timer-set-function timer 'with-timeout-handler
- '(sit-for-timeout))
- (timer-activate timer)
- (push (read-event) unread-command-events)
- nil)
- t
- (cancel-timer timer)
- nil))))
+ (if noninteractive
+ (progn (sleep-for seconds) t)
+ (unless nodisp (redisplay))
+ (or (<= seconds 0)
+ (let ((timer (timer-create))
+ (echo-keystrokes 0))
+ (if (catch 'sit-for-timeout
+ (timer-set-time timer (timer-relative-time
+ (current-time) seconds))
+ (timer-set-function timer 'with-timeout-handler
+ '(sit-for-timeout))
+ (timer-activate timer)
+ (push (read-event) unread-command-events)
+ nil)
+ t
+ (cancel-timer timer)
+ nil)))))
\f
;;; Atomic change groups.