aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer1996-02-21 21:33:35 +0000
committerKarl Heuer1996-02-21 21:33:35 +0000
commitb36bca9ac2ca709aa1b061c78086503261f75335 (patch)
tree2e91b7de75be034d0c2c06f5e27dfcb6a266d72a /lisp
parent5dee7dae097e89eaef06e2e2cea6d3b45b376746 (diff)
downloademacs-b36bca9ac2ca709aa1b061c78086503261f75335.tar.gz
emacs-b36bca9ac2ca709aa1b061c78086503261f75335.zip
(display-time-update): New subroutine broken out from
display-time-event-handler. (display-time): Add hook to rmail-get-new-mail-hook.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/time.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/time.el b/lisp/time.el
index af5cb03c347..76c3b08bbdd 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -74,7 +74,9 @@ After each update, `display-time-hook' is run with `run-hooks'."
74 (append global-mode-string '(display-time-string)))) 74 (append global-mode-string '(display-time-string))))
75 (timer-set-time display-time-timer (current-time) display-time-interval) 75 (timer-set-time display-time-timer (current-time) display-time-interval)
76 (timer-set-function display-time-timer 'display-time-event-handler) 76 (timer-set-function display-time-timer 'display-time-event-handler)
77 (timer-activate display-time-timer)) 77 (timer-activate display-time-timer)
78 ;; When you get new mail, clear "Mail" from the mode line.
79 (add-hook 'rmail-get-new-mail-hook 'display-time-event-handler))
78 80
79(defvar display-time-string-forms 81(defvar display-time-string-forms
80 '((if display-time-day-and-date 82 '((if display-time-day-and-date
@@ -102,6 +104,15 @@ For example, the form
102would give mode line times like `94/12/30 21:07:48 (UTC)'.") 104would give mode line times like `94/12/30 21:07:48 (UTC)'.")
103 105
104(defun display-time-event-handler () 106(defun display-time-event-handler ()
107 (display-time-update)
108 ;; Do redisplay right now, if no input pending.
109 (sit-for 0))
110
111;; Update the display-time info for the mode line
112;; but don't redisplay right now. This is used for
113;; things like Rmail `g' that want to force an update
114;; which can wait for the next redisplay.
115(defun display-time-update ()
105 (let* ((now (current-time)) 116 (let* ((now (current-time))
106 (time (current-time-string now)) 117 (time (current-time-string now))
107 (load (condition-case () 118 (load (condition-case ()
@@ -152,9 +163,7 @@ would give mode line times like `94/12/30 21:07:48 (UTC)'.")
152 ;; This is inside the let binding, but we are not going to document 163 ;; This is inside the let binding, but we are not going to document
153 ;; what variables are available. 164 ;; what variables are available.
154 (run-hooks 'display-time-hook)) 165 (run-hooks 'display-time-hook))
155 (force-mode-line-update) 166 (force-mode-line-update))
156 ;; Do redisplay right now, if no input pending.
157 (sit-for 0))
158 167
159(defun display-time-file-nonempty-p (file) 168(defun display-time-file-nonempty-p (file)
160 (and (file-exists-p file) 169 (and (file-exists-p file)