aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-09-16 23:20:51 +0000
committerKarl Heuer1994-09-16 23:20:51 +0000
commit151ca1707130a0485038b3e6535503ebce465ad7 (patch)
tree2688d4258a11c9bdb39e466d33271b2a30057548
parent0349bab642103ec62bea96c3e12d3e7d6f8a8f4b (diff)
downloademacs-151ca1707130a0485038b3e6535503ebce465ad7.tar.gz
emacs-151ca1707130a0485038b3e6535503ebce465ad7.zip
(display-time-24hr-format): Doc fix.
(display-time-filter): Reenable code that got deleted during a mispatch.
-rw-r--r--lisp/time.el29
1 files changed, 18 insertions, 11 deletions
diff --git a/lisp/time.el b/lisp/time.el
index e9a57bf2400..77325f98a27 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -41,7 +41,7 @@ Default is system-dependent, and is the same as used by Rmail.")
41 "*Seconds between updates of time in the mode line.") 41 "*Seconds between updates of time in the mode line.")
42 42
43(defvar display-time-24hr-format nil 43(defvar display-time-24hr-format nil
44 "*Non-nill indicates time should be displayed as hh:mm, 0 <= hh <= 23. 44 "*Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
45Nil means 1 <= hh <= 12, and an AM/PM suffix is used.") 45Nil means 1 <= hh <= 12, and an AM/PM suffix is used.")
46 46
47(defvar display-time-string nil) 47(defvar display-time-string nil)
@@ -126,18 +126,25 @@ would give mode line times like `94/12/30 21:07:48 (UTC)'.")
126 (mail-spool-file (or display-time-mail-file 126 (mail-spool-file (or display-time-mail-file
127 (getenv "MAIL") 127 (getenv "MAIL")
128 (concat rmail-spool-directory 128 (concat rmail-spool-directory
129 (or (getenv "LOGNAME") 129 (user-login-name))))
130 (getenv "USER") 130 (mail (and (or (null display-time-server-down-time)
131 (user-login-name))))) 131 ;; If have been down for 20 min, try again.
132 (mail (and (file-exists-p mail-spool-file) 132 (> (- (nth 1 (current-time))
133 (display-time-file-nonempty-p mail-spool-file))) 133 display-time-server-down-time)
134 1200))
135 (let ((start-time (current-time)))
136 (prog1
137 (display-time-file-nonempty-p mail-spool-file)
138 (if (> (- (nth 1 (current-time)) (nth 1 start-time))
139 20)
140 ;; Record that mail file is not accessible.
141 (setq display-time-server-down-time
142 (nth 1 (current-time)))
143 ;; Record that mail file is accessible.
144 (setq display-time-server-down-time nil))))))
134 (24-hours (substring time 11 13)) 145 (24-hours (substring time 11 13))
135 (hour (string-to-int 24-hours)) 146 (hour (string-to-int 24-hours))
136 (12-hours (int-to-string (if (> hour 12) 147 (12-hours (int-to-string (1+ (% (+ hour 11) 12))))
137 (- hour 12)
138 (if (= hour 0)
139 12
140 hour))))
141 (am-pm (if (>= hour 12) "pm" "am")) 148 (am-pm (if (>= hour 12) "pm" "am"))
142 (minutes (substring time 14 16)) 149 (minutes (substring time 14 16))
143 (seconds (substring time 17 19)) 150 (seconds (substring time 17 19))