]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-expunge): Show the message only once, and only if needed.
authorRichard M. Stallman <rms@gnu.org>
Mon, 16 Mar 2009 14:04:28 +0000 (14:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 16 Mar 2009 14:04:28 +0000 (14:04 +0000)
If the current message was current before, just re-swap.

lisp/ChangeLog
lisp/mail/rmail.el

index 0c9a16d9dde2585ea2d577395016879b282393ed..4ab45886f724402b817bad92914a7ae7c1fbe617 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        * international/ccl.el (ccl-compile-if): Signal an error for
index 3fa649e32af10f5097e6f5552a8eaeede225cdcd..7016022607f6fc088bf75c84e3787b61ef1113e2 100644 (file)
@@ -3263,16 +3263,19 @@ See also user-option `rmail-confirm-expunge'."
   "Erase deleted messages from Rmail file and summary buffer."
   (interactive)
   (when (rmail-expunge-confirmed)
-    (let ((old-total rmail-total-messages)
-         (opoint (with-current-buffer rmail-buffer
-                   (when (rmail-buffers-swapped-p)
-                     (point)))))
-      (rmail-only-expunge dont-show)
-      (if (rmail-summary-exists)
-         (rmail-select-summary (rmail-update-summary))
-       (rmail-show-message-1 rmail-current-message)
-       (if (and (eq old-total rmail-total-messages) opoint)
-           (goto-char opoint))))))
+    (let ((was-deleted (rmail-message-deleted-p rmail-current-message))
+         (was-swapped (rmail-buffers-swapped-p)))
+      (rmail-only-expunge t)
+      (unless dont-show
+       (if (rmail-summary-exists)
+           (rmail-select-summary (rmail-update-summary))
+         ;; If we expunged the current message, a new one is current now,
+         ;; so show it.  If we weren't showing a message, show it. 
+         (if (or was-deleted (not was-swapped))
+             (rmail-show-message-1 rmail-current-message)
+           ;; Show the same message that was being shown before.
+           (rmail-swap-buffers)
+           (setq rmail-buffer-swapped t)))))))
 \f
 ;;;; *** Rmail Mailing Commands ***