changeset 100435:52f6ee5edde1

(pmail-search): Call pmail-swap-buffers-maybe.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 15 Dec 2008 15:06:50 +0000
parents f4b6b3bfdeae
children a86104b93aaa
files lisp/mail/pmail.el
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/pmail.el	Mon Dec 15 15:06:44 2008 +0000
+++ b/lisp/mail/pmail.el	Mon Dec 15 15:06:50 2008 +0000
@@ -3128,9 +3128,16 @@
   "Erase deleted messages from Pmail file and summary buffer."
   (interactive)
   (when (pmail-expunge-confirmed)
-    (pmail-only-expunge dont-show)
-    (if (pmail-summary-exists)
-	(pmail-select-summary (pmail-update-summary)))))
+    (let ((old-total pmail-total-messages)
+	  (opoint (with-current-buffer pmail-buffer
+		    (when pmail-buffers-swapped-p
+		      (point)))))
+      (pmail-only-expunge dont-show)
+      (if (pmail-summary-exists)
+	  (pmail-select-summary (pmail-update-summary))
+	(pmail-show-message pmail-current-message)
+	(if (and (eq old-total pmail-total-messages) opoint)
+	    (goto-char opoint))))))
 
 ;;;; *** Pmail Mailing Commands ***