Fix my mail address.
[bpt/emacs.git] / lisp / time.el
index 5f2e875..b158ef6 100644 (file)
@@ -1,7 +1,7 @@
 ;;; time.el --- display time, load and mail indicator in mode line of Emacs -*-coding: utf-8 -*-
 
-;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1993-1994, 1996, 2000-2011
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 
@@ -157,7 +157,7 @@ LABEL is a string to display as the label of that TIMEZONE's time."
   ;; Determine if zoneinfo style timezones are supported by testing that
   ;; America/New York and Europe/London return different timezones.
   (let (gmt nyt)
-    (set-time-zone-rule "America/New York")
+    (set-time-zone-rule "America/New_York")
     (setq nyt (format-time-string "%z"))
     (set-time-zone-rule "Europe/London")
     (setq gmt (format-time-string "%z"))
@@ -365,6 +365,25 @@ would give mode line times like `94/12/30 21:07:48 (UTC)'."
        size
       nil)))
 
+(with-no-warnings
+  ;; Warnings are suppresed to avoid "global/dynamic var `X' lacks a prefix".
+  (defvar now)
+  (defvar time)
+  (defvar load)
+  (defvar mail)
+  (defvar 24-hours)
+  (defvar hour)
+  (defvar 12-hours)
+  (defvar am-pm)
+  (defvar minutes)
+  (defvar seconds)
+  (defvar time-zone)
+  (defvar day)
+  (defvar year)
+  (defvar monthname)
+  (defvar month)
+  (defvar dayname))
+
 (defun display-time-update ()
   "Update the display-time info for the mode line.
 However, don't redisplay right now.
@@ -404,30 +423,31 @@ update which can wait for the next redisplay."
                               (getenv "MAIL")
                               (concat rmail-spool-directory
                                       (user-login-name))))
-        (mail (or (and display-time-mail-function
-                       (funcall display-time-mail-function))
-                  (and display-time-mail-directory
-                       (display-time-mail-check-directory))
-                  (and (stringp mail-spool-file)
-                       (or (null display-time-server-down-time)
-                           ;; If have been down for 20 min, try again.
-                           (> (- (nth 1 now) display-time-server-down-time)
-                              1200)
-                           (and (< (nth 1 now) display-time-server-down-time)
-                                (> (- (nth 1 now)
-                                      display-time-server-down-time)
-                                   -64336)))
-                       (let ((start-time (current-time)))
-                         (prog1
-                             (display-time-file-nonempty-p mail-spool-file)
-                           (if (> (- (nth 1 (current-time))
-                                     (nth 1 start-time))
-                                  20)
-                               ;; Record that mail file is not accessible.
-                               (setq display-time-server-down-time
-                                     (nth 1 (current-time)))
-                             ;; Record that mail file is accessible.
-                             (setq display-time-server-down-time nil)))))))
+        (mail (cond
+               (display-time-mail-function
+                (funcall display-time-mail-function))
+               (display-time-mail-directory
+                (display-time-mail-check-directory))
+               ((and (stringp mail-spool-file)
+                     (or (null display-time-server-down-time)
+                         ;; If have been down for 20 min, try again.
+                         (> (- (nth 1 now) display-time-server-down-time)
+                            1200)
+                         (and (< (nth 1 now) display-time-server-down-time)
+                              (> (- (nth 1 now)
+                                    display-time-server-down-time)
+                                 -64336))))
+                (let ((start-time (current-time)))
+                  (prog1
+                      (display-time-file-nonempty-p mail-spool-file)
+                    (if (> (- (nth 1 (current-time))
+                              (nth 1 start-time))
+                           20)
+                        ;; Record that mail file is not accessible.
+                        (setq display-time-server-down-time
+                              (nth 1 (current-time)))
+                      ;; Record that mail file is accessible.
+                      (setq display-time-server-down-time nil)))))))
          (24-hours (substring time 11 13))
          (hour (string-to-number 24-hours))
          (12-hours (int-to-string (1+ (% (+ hour 11) 12))))