]> git.eshelyaron.com Git - emacs.git/commitdiff
(pmail-search): Call pmail-swap-buffers-maybe.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 15 Dec 2008 15:06:50 +0000 (15:06 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 15 Dec 2008 15:06:50 +0000 (15:06 +0000)
lisp/mail/pmail.el

index 7b236f5241892c89991b8fcf3f4dbd58adeb5b14..89e8ab69037a784ac7c29c01c2007ff3acd5968f 100644 (file)
@@ -3128,9 +3128,16 @@ See also user-option `pmail-confirm-expunge'."
   "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))))))
 \f
 ;;;; *** Pmail Mailing Commands ***