From: Chong Yidong Date: Mon, 15 Dec 2008 15:06:50 +0000 (+0000) Subject: (pmail-search): Call pmail-swap-buffers-maybe. X-Git-Tag: emacs-pretest-23.0.90~1080 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=97a424b85894aa746343787ff064301e4a86094c;p=emacs.git (pmail-search): Call pmail-swap-buffers-maybe. --- diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el index 7b236f52418..89e8ab69037 100644 --- a/lisp/mail/pmail.el +++ b/lisp/mail/pmail.el @@ -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)))))) ;;;; *** Pmail Mailing Commands ***