From 32ffbb899184b1955d7cde2d7eb54faa7c28bd26 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Fri, 28 Aug 1992 18:44:39 +0000 Subject: [PATCH] Change date format to match Emacs. Conditionalize mail notification on presence of rmail. --- v7/src/edwin/notify.scm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/v7/src/edwin/notify.scm b/v7/src/edwin/notify.scm index 3602f61b4..8e89f955d 100644 --- a/v7/src/edwin/notify.scm +++ b/v7/src/edwin/notify.scm @@ -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 ;;; @@ -71,13 +71,13 @@ (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))) (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 -- 2.25.1