Fix problems with previous mode-line tweak by setting
authorChris Hanson <org/chris-hanson/cph>
Thu, 21 Dec 2000 05:00:25 +0000 (05:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 21 Dec 2000 05:00:25 +0000 (05:00 +0000)
mode-line-process to a procedure value that is called whenever the
mode line is generated.

v7/src/imail/imail-summary.scm

index b85821c76780857223b72236754498ec9a66129e..fe6bdf1f4b95a04a5a801243def7072642fc01b9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-summary.scm,v 1.35 2000/12/21 04:36:01 cph Exp $
+;;; $Id: imail-summary.scm,v 1.36 2000/12/21 05:00:25 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
@@ -227,16 +227,7 @@ SUBJECT is a string of regexps separated by commas."
             (if message
                 (imail-summary-select-message buffer message))))
          ((EXPUNGE INCREASE-LENGTH SET-LENGTH)
-          (maybe-add-command-suffix! rebuild-imail-summary-buffer buffer)))))
-  (local-set-variable!
-   mode-line-process
-   (string-append ": "
-                 (buffer-get buffer 'IMAIL-SUMMARY-DESCRIPTION "All")
-                 (let ((status (folder-connection-status folder)))
-                   (if (eq? status 'NO-SERVER)
-                       ""
-                       (string-append " " (symbol->string status)))))
-   buffer))
+          (maybe-add-command-suffix! rebuild-imail-summary-buffer buffer))))))
 \f
 ;;;; Summary content generation
 
@@ -590,6 +581,9 @@ with some additions to make navigation more natural.
     (buffer-put! buffer 'REVERT-BUFFER-METHOD imail-summary-revert-buffer)
     (remove-kill-buffer-hook buffer imail-kill-buffer)
     (local-set-variable! truncate-lines #t buffer)
+    (local-set-variable! mode-line-process
+                        imail-summary-mode-line-summary-string
+                        buffer)
     (event-distributor/invoke! (ref-variable imail-summary-mode-hook buffer)
                               buffer)))
 
@@ -601,6 +595,19 @@ with some additions to make navigation more natural.
   dont-use-auto-save?
   (if (or dont-confirm? (prompt-for-yes-or-no? "Revert summary buffer"))
       (rebuild-imail-summary-buffer buffer)))
+
+(define (imail-summary-mode-line-summary-string window)
+  (let* ((buffer (window-buffer window))
+        (folder (selected-folder #f buffer)))
+    (if folder
+       (string-append
+        (let ((status (folder-connection-status folder)))
+          (if (eq? status 'NO-SERVER)
+              ""
+              (string-append " " (symbol->string status))))
+        ": "
+        (buffer-get buffer 'IMAIL-SUMMARY-DESCRIPTION "All"))
+       "")))
 \f
 (define-key 'imail-summary #\space     'imail-summary-scroll-msg-up)
 (define-key 'imail-summary #\rubout    'imail-summary-scroll-msg-down)