From 04ba1d88de793b42bace58f811cf3036cc59ca82 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 26 Jul 2006 18:18:26 +0000 Subject: [PATCH] * subr.el (sit-for): Use new SECONDS arg of read-event instead of a timer. --- lisp/ChangeLog | 5 +++++ lisp/subr.el | 16 +++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 04e6d7745f8..ea7209f22ae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-07-26 Chong Yidong + + * subr.el (sit-for): Use new SECONDS arg of read-event instead of + a timer. + 2006-07-26 Mathias Dahl * tumme.el (tumme-backward-image): Add prefix argument. Add error diff --git a/lisp/subr.el b/lisp/subr.el index 6a4349e5725..b2ea997d623 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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)))))) ;;; Atomic change groups. -- 2.39.2