diff options
| -rw-r--r-- | lisp/mail/rmail.el | 31 |
1 files changed, 19 insertions, 12 deletions
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.") | |||
| 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 | ||