;;; -*-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."
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
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)
((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