;;; -*-Scheme-*-
;;;
-;;; $Id: imail-top.scm,v 1.192 2000/06/26 19:08:18 cph Exp $
+;;; $Id: imail-top.scm,v 1.193 2000/06/26 19:30:33 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(define-variable imail-mime-show-alternatives
"If true, all parts of a multipart/alternative message are shown.
-\(Only one of the parts will be shown in line; the others as attachments.)
+ (Only one of the parts will be shown in-line; the others as attachments.)
Otherwise, only one of the parts is shown."
#f
boolean?)
+
+(define-variable imail-global-mail-notification
+ "If true, all buffer modelines say if there is unseen mail.
+ (This checks only for unseen mail in the primary folder.)
+Otherwise, only the IMAIL buffer for that folder has an indicator."
+ #t
+ boolean?)
\f
(define-command imail
"Read and edit incoming mail.
(local-set-variable! mode-line-process
(imail-mode-line-summary-string buffer)
buffer)
+ (if (and (ref-variable imail-global-mail-notification buffer)
+ (eq? (folder-url folder) (imail-default-url)))
+ (begin
+ (set-variable! global-mode-string
+ (if (> (count-unseen-messages folder) 0)
+ "[New Mail]"
+ ""))
+ (global-window-modeline-event!)))
(buffer-modeline-event! buffer 'PROCESS-STATUS)))))
(define (imail-mode-line-summary-string buffer)
(else "0")))
"/"
(number->string n)
- (let loop ((i 0) (unseen 0))
- (cond ((< i n)
- (loop (+ i 1)
- (if (message-unseen? (get-message folder i))
- (+ unseen 1)
- unseen)))
- ((> unseen 0)
- (string-append " (" (number->string unseen) " unseen)"))
- (else "")))
+ (let ((unseen (count-unseen-messages folder)))
+ (if (> unseen 0)
+ (string-append " (" (number->string unseen) " unseen)")
+ ""))
(let ((flags
(if message
(flags-delete "seen" (message-flags message))
(if (pair? flags)
(string-append " " (decorated-string-append "" "," "" flags))
"")))))))
+
+(define (count-unseen-messages folder)
+ (let ((n (folder-length folder)))
+ (do ((i 0 (+ i 1))
+ (unseen 0
+ (if (message-unseen? (get-message folder i))
+ (+ unseen 1)
+ unseen)))
+ ((= i n) unseen))))
\f
;;;; Probe-folder thread
;;; -*-Scheme-*-
;;;
-;;; $Id: imail.pkg,v 1.67 2000/06/26 19:02:38 cph Exp $
+;;; $Id: imail.pkg,v 1.68 2000/06/26 19:30:57 cph Exp $
;;;
;;; Copyright (c) 2000 Massachusetts Institute of Technology
;;;
edwin-variable$imail-expunge-confirmation
edwin-variable$imail-forward-all-headers
edwin-variable$imail-forward-using-mime
+ edwin-variable$imail-global-mail-notification
edwin-variable$imail-ignored-headers
edwin-variable$imail-inline-mime-text-subtypes
edwin-variable$imail-kept-headers
IMAIL To-Do List
-$Id: todo.txt,v 1.98 2000/06/26 19:02:39 cph Exp $
+$Id: todo.txt,v 1.99 2000/06/26 19:31:07 cph Exp $
Bug fixes
---------
folder is locally modified. Meaningful only for file folders. Hook
up the save-folder code into M-x save-some-buffers.
-* Add mail notification in mode line, active across the editor as long
- as there is an IMAP connection open in some buffer.
-
* Implement cache that saves information about messages on disk. This
should use UIDs for IMAP folders; for other folders perhaps the
message ID can be used. (Or perhaps no cache is required for