summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-12-09 19:35:06 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-12-09 19:35:06 +0000
commit397b4cd0fde88987d8c03752fa365e6cf6630f59 (patch)
treead741c11c2dfb5546df0e7b29f364850479f543f
parent5b681764fe0493ada0437029f454bd80268e0742 (diff)
downloademacs-397b4cd0fde88987d8c03752fa365e6cf6630f59.tar.gz
(pmail-only-expunge): Swap buffers at the beginning.
-rw-r--r--lisp/mail/pmail.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el
index 1549d98ac08..a863acc6573 100644
--- a/lisp/mail/pmail.el
+++ b/lisp/mail/pmail.el
@@ -3491,6 +3491,7 @@ See also user-option `pmail-confirm-expunge'."
(defun pmail-only-expunge (&optional dont-show)
"Actually erase all deleted messages in the file."
(interactive)
+ (pmail-swap-buffers-maybe)
(set-buffer pmail-buffer)
(message "Expunging deleted messages...")
;; Discard all undo records for this buffer.
@@ -3517,12 +3518,11 @@ See also user-option `pmail-confirm-expunge'."
(goto-char (point-min))
(let ((counter 0)
(number 1)
- (total pmail-total-messages)
- (new-message-number pmail-current-message)
- (new-summary nil)
+ new-summary
(new-msgref (list (list 0)))
- (pmailbuf (current-buffer))
(buffer-read-only nil)
+ (total pmail-total-messages)
+ (new-message-number pmail-current-message)
(messages pmail-message-vector)
(deleted pmail-deleted-vector)
(summary pmail-summary-vector))
@@ -3535,9 +3535,8 @@ See also user-option `pmail-confirm-expunge'."
(while (<= number total)
(if (= (aref deleted number) ?D)
(progn
- (delete-region
- (marker-position (aref messages number))
- (marker-position (aref messages (1+ number))))
+ (delete-region (aref messages number)
+ (aref messages (1+ number)))
(move-marker (aref messages number) nil)
(if (> new-message-number counter)
(setq new-message-number (1- new-message-number))))
@@ -3569,7 +3568,6 @@ See also user-option `pmail-confirm-expunge'."
(narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax)))
(if (not dont-show)
(pmail-show-message-maybe (min pmail-current-message pmail-total-messages)))
- (pmail-swap-buffers-maybe)
(if pmail-enable-mime
(goto-char (+ (point-min) opoint))
(goto-char (+ (point) opoint))))))