diff options
| author | Chong Yidong | 2006-07-18 01:34:48 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-07-18 01:34:48 +0000 |
| commit | c1fdbde6c8c1e007d5abe6fba012fb1a2c09c448 (patch) | |
| tree | 485ebe36703d14eb4217bee9d0a12c844a913288 | |
| parent | 7c0c29ee3570354017b7f76c1bd3da46581b6711 (diff) | |
| download | emacs-c1fdbde6c8c1e007d5abe6fba012fb1a2c09c448.tar.gz emacs-c1fdbde6c8c1e007d5abe6fba012fb1a2c09c448.zip | |
* subr.el (sit-for): Just sleep-for if noninteractive.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 33 |
2 files changed, 21 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 22d4caba884..ffeac9d760a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-07-17 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * subr.el (sit-for): Just sleep-for if noninteractive. | ||
| 4 | |||
| 1 | 2006-07-17 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2006-07-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * emacs-lisp/autoload.el (make-autoload): Use new arg. | 7 | * emacs-lisp/autoload.el (make-autoload): Use new arg. |
diff --git a/lisp/subr.el b/lisp/subr.el index d80bec4402a..a94096b184e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1721,22 +1721,23 @@ floating point support. | |||
| 1721 | (when (or obsolete (numberp nodisp)) | 1721 | (when (or obsolete (numberp nodisp)) |
| 1722 | (setq seconds (+ seconds (* 1e-3 nodisp))) | 1722 | (setq seconds (+ seconds (* 1e-3 nodisp))) |
| 1723 | (setq nodisp obsolete)) | 1723 | (setq nodisp obsolete)) |
| 1724 | (unless nodisp | 1724 | (if noninteractive |
| 1725 | (redisplay)) | 1725 | (progn (sleep-for seconds) t) |
| 1726 | (or (<= seconds 0) | 1726 | (unless nodisp (redisplay)) |
| 1727 | (let ((timer (timer-create)) | 1727 | (or (<= seconds 0) |
| 1728 | (echo-keystrokes 0)) | 1728 | (let ((timer (timer-create)) |
| 1729 | (if (catch 'sit-for-timeout | 1729 | (echo-keystrokes 0)) |
| 1730 | (timer-set-time timer (timer-relative-time | 1730 | (if (catch 'sit-for-timeout |
| 1731 | (current-time) seconds)) | 1731 | (timer-set-time timer (timer-relative-time |
| 1732 | (timer-set-function timer 'with-timeout-handler | 1732 | (current-time) seconds)) |
| 1733 | '(sit-for-timeout)) | 1733 | (timer-set-function timer 'with-timeout-handler |
| 1734 | (timer-activate timer) | 1734 | '(sit-for-timeout)) |
| 1735 | (push (read-event) unread-command-events) | 1735 | (timer-activate timer) |
| 1736 | nil) | 1736 | (push (read-event) unread-command-events) |
| 1737 | t | 1737 | nil) |
| 1738 | (cancel-timer timer) | 1738 | t |
| 1739 | nil)))) | 1739 | (cancel-timer timer) |
| 1740 | nil))))) | ||
| 1740 | 1741 | ||
| 1741 | ;;; Atomic change groups. | 1742 | ;;; Atomic change groups. |
| 1742 | 1743 | ||