]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-select-summary): Preserve rmail buffer's value of
authorRichard M. Stallman <rms@gnu.org>
Thu, 4 Aug 1994 22:33:36 +0000 (22:33 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 4 Aug 1994 22:33:36 +0000 (22:33 +0000)
rmail-total-messages even while summary buffer is current.

lisp/mail/rmail.el

index 4d1a3471e67bc04954f5f5bb1470d5af949531bf..79649a935b6639ec41a954db7cd4ef36031cc621 100644 (file)
@@ -200,18 +200,25 @@ Called with region narrowed to the message, including headers.")
 ;; Perform BODY in the summary buffer
 ;; in such a way that its cursor is properly updated in its own window.
 (defmacro rmail-select-summary (&rest body)
-  (` (progn (if (rmail-summary-displayed)
-               (let ((window (selected-window)))
-                 (save-excursion
-                   (unwind-protect
-                       (progn
-                         (pop-to-buffer rmail-summary-buffer)
-                         (,@ body))
-                     (select-window window))))
-             (save-excursion
-               (set-buffer rmail-summary-buffer)
-               (progn (,@ body))))
-           (rmail-maybe-display-summary))))
+  (` (let ((total rmail-total-messages))
+       (if (rmail-summary-displayed)
+          (let ((window (selected-window)))
+            (save-excursion
+              (unwind-protect
+                  (progn
+                    (pop-to-buffer rmail-summary-buffer)
+                    ;; rmail-total-messages is a buffer-local var
+                    ;; in the rmail buffer.
+                    ;; This way we make it available for the body
+                    ;; even tho the rmail buffer is not current.
+                    (let ((rmail-total-messages total))
+                      (,@ body)))
+                (select-window window))))
+        (save-excursion
+          (set-buffer rmail-summary-buffer)
+          (let ((rmail-total-messages total))
+            (,@ body))))
+       (rmail-maybe-display-summary))))
 \f
 ;;;; *** Rmail Mode ***