From: Richard M. Stallman Date: Thu, 4 Aug 1994 22:33:36 +0000 (+0000) Subject: (rmail-select-summary): Preserve rmail buffer's value of X-Git-Tag: emacs-19.34~7406 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a05fc4d9f176d6aa73bee8c807be2b70edf6e951;p=emacs.git (rmail-select-summary): Preserve rmail buffer's value of rmail-total-messages even while summary buffer is current. --- diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 4d1a3471e67..79649a935b6 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -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)))) ;;;; *** Rmail Mode ***