From 1f3616ea45d9e80f3a0d976d9a6e088544028f03 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 4 Mar 1994 21:30:40 +0000 Subject: [PATCH] Change notifier to use only the GLOBAL-MODE-STRING editor variable. --- v7/src/edwin/modlin.scm | 5 ++--- v7/src/edwin/notify.scm | 49 ++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/v7/src/edwin/modlin.scm b/v7/src/edwin/modlin.scm index 53c38b3a3..6a512e4cd 100644 --- a/v7/src/edwin/modlin.scm +++ b/v7/src/edwin/modlin.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: modlin.scm,v 1.16 1993/08/10 06:48:48 cph Exp $ +;;; $Id: modlin.scm,v 1.17 1994/03/04 21:30:33 cph Exp $ ;;; -;;; Copyright (c) 1989-93 Massachusetts Institute of Technology +;;; Copyright (c) 1989-94 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -77,7 +77,6 @@ Decimal digits after the % specify field width to which to pad." mode-line-buffer-identification " " global-mode-string - notify-string " %[(%M%m%n" mode-line-process ")%]----" diff --git a/v7/src/edwin/notify.scm b/v7/src/edwin/notify.scm index da2e883b8..51614079e 100644 --- a/v7/src/edwin/notify.scm +++ b/v7/src/edwin/notify.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: notify.scm,v 1.13 1993/11/17 22:23:14 cph Exp $ +;;; $Id: notify.scm,v 1.14 1994/03/04 21:30:40 cph Exp $ ;;; -;;; Copyright (c) 1992-93 Massachusetts Institute of Technology +;;; Copyright (c) 1992-94 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -141,19 +141,17 @@ Ignored if notify-show-mail is false." (cons (ref-variable-object notify-show-time) notifier:time) (cons (ref-variable-object notify-show-load) notifier:load-average))) -(define (update-notify-string! string) - (set-variable! notify-string - (if (or (string-null? (ref-variable global-mode-string)) - (string-null? string)) - string - (string-append " " string))) - (global-window-modeline-event!)) +(define (notifier:get-string window) + window + (string-append-separated notifier-element-string notifier-mail-string)) -(define-variable notify-string - "This is an internal variable. Don't change it." - "" - string?) +(define (update-notifier-strings! element mail) + (set! notifier-element-string element) + (set! notifier-mail-string mail) + (global-window-modeline-event!)) +(define notifier-element-string "") +(define notifier-mail-string "") (define mail-notify-hook-installed? #f) (define current-notifier-thread #f) (define notifier-thread-registration #f) @@ -170,13 +168,15 @@ which can show various things including time, load average, and mail status." (add-event-receiver! (ref-variable rmail-new-mail-hook) (lambda () - (update-notify-string! + (update-notifier-strings! + notifier-element-string (if (ref-variable notify-show-mail) (ref-variable notify-mail-not-present) "")))) (set! mail-notify-hook-installed? #t) unspecific)) ((ref-command kill-notifier)) + (set-variable! global-mode-string `("" ,notifier:get-string)) (let ((thread (create-thread editor-thread-root-continuation @@ -193,16 +193,15 @@ which can show various things including time, load average, and mail status." unspecific)) (define (notifier) - (set-variable! global-mode-string - (reduce string-append-separated - "" - (map (lambda (element) - (if (and (car element) - (variable-value (car element))) - ((cdr element)) - "")) - notifier-elements))) - (update-notify-string! + (update-notifier-strings! + (reduce string-append-separated + "" + (map (lambda (element) + (if (and (car element) + (variable-value (car element))) + ((cdr element)) + "")) + notifier-elements)) (if (and mail-notify-hook-installed? (ref-variable notify-show-mail)) (notifier:mail-present) @@ -228,4 +227,4 @@ which can show various things including time, load average, and mail status." (set! notifier-thread-registration #f))) unspecific)) (set-variable! global-mode-string "") - (update-notify-string! ""))) \ No newline at end of file + (update-notifier-strings! "" ""))) \ No newline at end of file -- 2.25.1