changeset 8447:0e699538d256

(rmail-select-summary): Preserve rmail buffer's value of rmail-total-messages even while summary buffer is current.
author Richard M. Stallman <rms@gnu.org>
date Thu, 04 Aug 1994 22:33:36 +0000
parents 0199ece40d91
children b6335ce87e16
files lisp/mail/rmail.el
diffstat 1 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Thu Aug 04 21:47:55 1994 +0000
+++ b/lisp/mail/rmail.el	Thu Aug 04 22:33:36 1994 +0000
@@ -200,18 +200,25 @@
 ;; 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))))
 
 ;;;; *** Rmail Mode ***