comparison lisp/mail/rmail.el @ 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 960d9fb24788
children 07a5f6c2bc9f
comparison
equal deleted inserted replaced
8446:0199ece40d91 8447:0e699538d256
198 nil) 198 nil)
199 199
200 ;; Perform BODY in the summary buffer 200 ;; Perform BODY in the summary buffer
201 ;; in such a way that its cursor is properly updated in its own window. 201 ;; in such a way that its cursor is properly updated in its own window.
202 (defmacro rmail-select-summary (&rest body) 202 (defmacro rmail-select-summary (&rest body)
203 (` (progn (if (rmail-summary-displayed) 203 (` (let ((total rmail-total-messages))
204 (let ((window (selected-window))) 204 (if (rmail-summary-displayed)
205 (save-excursion 205 (let ((window (selected-window)))
206 (unwind-protect 206 (save-excursion
207 (progn 207 (unwind-protect
208 (pop-to-buffer rmail-summary-buffer) 208 (progn
209 (,@ body)) 209 (pop-to-buffer rmail-summary-buffer)
210 (select-window window)))) 210 ;; rmail-total-messages is a buffer-local var
211 (save-excursion 211 ;; in the rmail buffer.
212 (set-buffer rmail-summary-buffer) 212 ;; This way we make it available for the body
213 (progn (,@ body)))) 213 ;; even tho the rmail buffer is not current.
214 (rmail-maybe-display-summary)))) 214 (let ((rmail-total-messages total))
215 (,@ body)))
216 (select-window window))))
217 (save-excursion
218 (set-buffer rmail-summary-buffer)
219 (let ((rmail-total-messages total))
220 (,@ body))))
221 (rmail-maybe-display-summary))))
215 222
216 ;;;; *** Rmail Mode *** 223 ;;;; *** Rmail Mode ***
217 224
218 ;;;###autoload 225 ;;;###autoload
219 (defun rmail (&optional file-name-arg) 226 (defun rmail (&optional file-name-arg)