Change date format to match Emacs.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 28 Aug 1992 18:44:39 +0000 (18:44 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 28 Aug 1992 18:44:39 +0000 (18:44 +0000)
Conditionalize mail notification on presence of rmail.

v7/src/edwin/notify.scm

index 3602f61b442559c804fde2c7417c216a2ca9aff4..8e89f955da9552623898dcb2ab054719b8d4f0ac 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/notify.scm,v 1.8 1992/03/08 17:38:09 arthur Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/notify.scm,v 1.9 1992/08/28 18:44:39 jinx Exp $
 ;;;
 ;;;    Copyright (c) 1992 Massachusetts Institute of Technology
 ;;;
 (define (notifier:date)
   (let ((time (get-decoded-time)))
     (string-append (vector-ref
-                   '#("Mon " "Tue " "Wed " "Thu " "Fri " "Sat " "Sun ")
+                   '#("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")
                    (decoded-time/day-of-week time))
-                  (write-to-string (decoded-time/day time))
                   (vector-ref
-                   '#(" Jan" " Feb" " Mar" " Apr" " May" " Jun"
-                     " Jul" " Aug" " Sep" " Oct" " Nov" " Dec")
-                   (-1+ (decoded-time/month time))))))
+                   '#("??" " Jan " " Feb " " Mar " " Apr " " May " " Jun "
+                           " Jul " " Aug " " Sep " " Oct " " Nov " " Dec ")
+                   (decoded-time/month time))
+                  (write-to-string (decoded-time/day time)))))
 
 (define-variable notify-show-load
   "If true, the notifier displays the load average."
@@ -137,8 +137,8 @@ Ignored if notify-show-mail is false."
   exact-nonnegative-integer?)
 
 (define notifier-elements
-  (list (cons (ref-variable-object notify-show-time) notifier:time)
-       (cons (ref-variable-object notify-show-date) notifier:date)
+  (list (cons (ref-variable-object notify-show-date) notifier:date)
+       (cons (ref-variable-object notify-show-time) notifier:time)
        (cons (ref-variable-object notify-show-load) notifier:load-average)))
 \f
 (define-command run-notifier
@@ -147,7 +147,8 @@ The notifier maintains a simple display in the modeline,
 which can show various things including time, load average, and mail status."
   ()
   (lambda ()
-    (if (not mail-notify-hook-installed?)
+    (if (and (not mail-notify-hook-installed?)
+            (command-defined? rmail))
        (begin
          (add-event-receiver!
           (ref-variable rmail-new-mail-hook)
@@ -183,10 +184,11 @@ which can show various things including time, load average, and mail status."
                                    ((cdr element))
                                    ""))
                              notifier-elements)))
-  (update-notify-string!
-   (if (ref-variable notify-show-mail)
-       (notifier:mail-present)
-       ""))
+  (if mail-notify-hook-installed?
+      (update-notify-string!
+       (if (ref-variable notify-show-mail)
+          (notifier:mail-present)
+          "")))
   true)
 
 (define-command kill-notifier