emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105201: Allow display-time-mail-func


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105201: Allow display-time-mail-function to return nil
Date: Thu, 14 Jul 2011 16:30:35 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105201
fixes bug(s): http://debbugs.gnu.org/7158
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Thu 2011-07-14 16:30:35 +0200
message:
  Allow display-time-mail-function to return nil
  
  * time.el (display-time-update): Allow
  `display-time-mail-function' to return nil (bug#7158).  Fix
  suggested by Detlev Zundel.
modified:
  lisp/ChangeLog
  lisp/time.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-14 14:15:06 +0000
+++ b/lisp/ChangeLog    2011-07-14 14:30:35 +0000
@@ -1,5 +1,9 @@
 2011-07-14  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * time.el (display-time-update): Allow
+       `display-time-mail-function' to return nil (bug#7158).  Fix
+       suggested by Detlev Zundel.
+
        * vc/diff.el (diff): Clarify the order the file names are read
        (bug#7111).
 

=== modified file 'lisp/time.el'
--- a/lisp/time.el      2011-04-19 13:44:55 +0000
+++ b/lisp/time.el      2011-07-14 14:30:35 +0000
@@ -423,30 +423,31 @@
                               (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))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]