Mercurial > emacs
changeset 14698:87d459e75dad
(display-time): Use run-at-time to start the timer.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 27 Feb 1996 17:44:45 +0000 |
parents | 5a7714d4748e |
children | e7f7883b9277 |
files | lisp/time.el |
diffstat | 1 files changed, 4 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/time.el Tue Feb 27 16:51:25 1996 +0000 +++ b/lisp/time.el Tue Feb 27 17:44:45 1996 +0000 @@ -63,18 +63,15 @@ are displayed as well. After each update, `display-time-hook' is run with `run-hooks'." (interactive) - (require 'timer) - (if (timerp display-time-timer) - (cancel-timer display-time-timer) - (setq display-time-timer (timer-create))) (setq display-time-string "") (or global-mode-string (setq global-mode-string '(""))) (or (memq 'display-time-string global-mode-string) (setq global-mode-string (append global-mode-string '(display-time-string)))) - (timer-set-time display-time-timer (current-time) display-time-interval) - (timer-set-function display-time-timer 'display-time-event-handler) - (timer-activate display-time-timer) + ;; Setup the time timer. + (and display-time-timer (cancel-timer display-time-timer)) + (setq display-time-timer + (run-at-time nil display-time-interval 'display-time-event-handler)) ;; When you get new mail, clear "Mail" from the mode line. (add-hook 'rmail-get-new-mail-hook 'display-time-event-handler))