From: Chris Hanson Date: Thu, 18 May 2000 03:59:43 +0000 (+0000) Subject: Add folder event to signal selection of a message in the front end. X-Git-Tag: 20090517-FFI~3827 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e69927d9a78f06b4193ba5b04ca7d67445d25506;p=mit-scheme.git Add folder event to signal selection of a message in the front end. Unlike other folder events, this one doesn't update the folder's modification count, so split of a procedure FOLDER-EVENT to handle cases like this. --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index ab7bbc6c2..686839764 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-core.scm,v 1.69 2000/05/18 03:42:55 cph Exp $ +;;; $Id: imail-core.scm,v 1.70 2000/05/18 03:59:43 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -213,6 +213,9 @@ (set-folder-modification-count! folder (+ (folder-modification-count folder) 1)))) + (apply folder-event folder type parameters)) + +(define (folder-event folder type . parameters) (event-distributor/invoke! (folder-modification-event folder) folder type diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index 608c4450b..de2c03924 100644 --- a/v7/src/imail/imail-top.scm +++ b/v7/src/imail/imail-top.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-top.scm,v 1.59 2000/05/18 03:43:06 cph Exp $ +;;; $Id: imail-top.scm,v 1.60 2000/05/18 03:59:29 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -131,11 +131,6 @@ May be called with an IMAIL folder URL as argument; (call-with-pass-phrase (string-append "Password for user " user-id " on host " host) receiver)) - -(define (notice-folder-modifications folder) - (let ((buffer (imail-folder->buffer folder #f))) - (if buffer - (imail-update-mode-line! buffer)))) (define (imail-default-url) (let ((primary-folder (ref-variable imail-primary-folder))) @@ -467,7 +462,7 @@ With prefix argument N moves backward N messages with these flags." (buffer-not-modified! buffer))) (if message (message-seen message)) - (imail-update-mode-line! buffer))) + (folder-event folder 'SELECT-MESSAGE message))) (define (associate-imail-with-buffer buffer folder message) (without-interrupts @@ -569,11 +564,14 @@ With prefix argument N moves backward N messages with these flags." (and (if (default-object? error?) #t error?) (error "No selected IMAIL message.")))) -(define (imail-update-mode-line! buffer) - (local-set-variable! mode-line-process - (imail-mode-line-summary-string buffer) - buffer) - (buffer-modeline-event! buffer 'PROCESS-STATUS)) +(define (notice-folder-modifications folder) + (let ((buffer (imail-folder->buffer folder #f))) + (if buffer + (begin + (local-set-variable! mode-line-process + (imail-mode-line-summary-string buffer) + buffer) + (buffer-modeline-event! buffer 'PROCESS-STATUS))))) (define (imail-mode-line-summary-string buffer) (let ((message (selected-message #f buffer)))