Function: display-time-update
display-time-update is a byte-compiled function defined in time.el.gz.
Signature
(display-time-update)
Documentation
Update the display-time info for the mode line.
However, don't redisplay right now.
This is used for things like Rmail g that want to force an
update which can wait for the next redisplay.
Source Code
;; Defined in /usr/src/emacs/lisp/time.el.gz
(defun display-time-update ()
"Update the `display-time' info for the mode line.
However, don't redisplay right now.
This is used for things like Rmail `g' that want to force an
update which can wait for the next redisplay."
(let* ((now (current-time))
(time (current-time-string now))
(load (display-time-update--load))
(mail (display-time-update--mail))
(24-hours (substring time 11 13))
(hour (string-to-number 24-hours))
(12-hours (int-to-string (1+ (% (+ hour 11) 12))))
(am-pm (if (>= hour 12) "pm" "am"))
(minutes (substring time 14 16))
(seconds (substring time 17 19))
(time-zone (car (cdr (current-time-zone now))))
(day (substring time 8 10))
(year (format-time-string "%Y" now))
(monthname (substring time 4 7))
(month
(cdr
(assoc
monthname
'(("Jan" . "1") ("Feb" . "2") ("Mar" . "3") ("Apr" . "4")
("May" . "5") ("Jun" . "6") ("Jul" . "7") ("Aug" . "8")
("Sep" . "9") ("Oct" . "10") ("Nov" . "11") ("Dec" . "12")))))
(dayname (substring time 0 3)))
(setq display-time-string
(mapconcat 'eval display-time-string-forms ""))
;; This is inside the let binding, but we are not going to document
;; what variables are available.
(run-hooks 'display-time-hook))
(force-mode-line-update 'all))