]> git.eshelyaron.com Git - emacs.git/commitdiff
* subr.el (sit-for): Use new SECONDS arg of read-event instead of
authorChong Yidong <cyd@stupidchicken.com>
Wed, 26 Jul 2006 18:18:26 +0000 (18:18 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 26 Jul 2006 18:18:26 +0000 (18:18 +0000)
a timer.

lisp/ChangeLog
lisp/subr.el

index 04e6d7745f8ab743d7373726f0b90fa317d2a48d..ea7209f22ae170124c6915937503b49992208591 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-26  Chong Yidong  <cyd@stupidchicken.com>
+
+       * subr.el (sit-for): Use new SECONDS arg of read-event instead of
+       a timer.
+
 2006-07-26  Mathias Dahl  <mathias.dahl@gmail.com>
 
        * tumme.el (tumme-backward-image): Add prefix argument. Add error
index 6a4349e5725493c43460a8e7e28d81b60425e5bc..b2ea997d62353436178fdec66c85d397a11fc5ef 100644 (file)
@@ -1737,19 +1737,9 @@ floating point support.
       (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)))))
+       (let ((read (read-event nil nil seconds)))
+         (or (null read)
+             (progn (push read unread-command-events) nil))))))
 \f
 ;;; Atomic change groups.