emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/mail rmail.el


From: Richard M. Stallman
Subject: [Emacs-diffs] emacs/lisp/mail rmail.el
Date: Mon, 16 Mar 2009 14:04:11 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       09/03/16 14:04:11

Modified files:
        lisp/mail      : rmail.el 

Log message:
        (rmail-expunge): Show the message only once, and only if needed.
        If the current message was current before, just re-swap.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.524&r2=1.525

Patches:
Index: rmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.524
retrieving revision 1.525
diff -u -b -r1.524 -r1.525
--- rmail.el    16 Mar 2009 13:42:31 -0000      1.524
+++ rmail.el    16 Mar 2009 14:04:11 -0000      1.525
@@ -3263,16 +3263,19 @@
   "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)
+    (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)
-       (if (and (eq old-total rmail-total-messages) opoint)
-           (goto-char opoint))))))
+           ;; Show the same message that was being shown before.
+           (rmail-swap-buffers)
+           (setq rmail-buffer-swapped t)))))))
 
 ;;;; *** Rmail Mailing Commands ***
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]