Commit 0b9b4ab9 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(rmail-expunge): Show the message only once, and only if needed.

If the current message was current before, just re-swap.
parent a6cf3c4e
2009-03-16 Richard M Stallman <rms@gnu.org>
* mail/rmail.el (rmail-retry-failure): Discard rmail-ignored-headers.
(rmail-expunge): Show the message only once, and only if needed.
If the current message was current before, just re-swap.
2009-03-16 Kenichi Handa <handa@m17n.org> 2009-03-16 Kenichi Handa <handa@m17n.org>
   
* international/ccl.el (ccl-compile-if): Signal an error for * international/ccl.el (ccl-compile-if): Signal an error for
......
...@@ -3263,16 +3263,19 @@ See also user-option `rmail-confirm-expunge'." ...@@ -3263,16 +3263,19 @@ See also user-option `rmail-confirm-expunge'."
"Erase deleted messages from Rmail file and summary buffer." "Erase deleted messages from Rmail file and summary buffer."
(interactive) (interactive)
(when (rmail-expunge-confirmed) (when (rmail-expunge-confirmed)
(let ((old-total rmail-total-messages) (let ((was-deleted (rmail-message-deleted-p rmail-current-message))
(opoint (with-current-buffer rmail-buffer (was-swapped (rmail-buffers-swapped-p)))
(when (rmail-buffers-swapped-p) (rmail-only-expunge t)
(point))))) (unless dont-show
(rmail-only-expunge dont-show) (if (rmail-summary-exists)
(if (rmail-summary-exists) (rmail-select-summary (rmail-update-summary))
(rmail-select-summary (rmail-update-summary)) ;; If we expunged the current message, a new one is current now,
(rmail-show-message-1 rmail-current-message) ;; so show it. If we weren't showing a message, show it.
(if (and (eq old-total rmail-total-messages) opoint) (if (or was-deleted (not was-swapped))
(goto-char opoint)))))) (rmail-show-message-1 rmail-current-message)
;; Show the same message that was being shown before.
(rmail-swap-buffers)
(setq rmail-buffer-swapped t)))))))
;;;; *** Rmail Mailing Commands *** ;;;; *** Rmail Mailing Commands ***
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment