aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-04-07 03:01:08 +0000
committerGlenn Morris2009-04-07 03:01:08 +0000
commit384b53ab0fd58e74ec92c664ee4dff2b7aeaed4c (patch)
tree07325a2326125768604345d8ea54a786cbec4c5d
parent71de5c37a1a3dd2191b36a6ec116a4baafcecaa3 (diff)
downloademacs-384b53ab0fd58e74ec92c664ee4dff2b7aeaed4c.tar.gz
emacs-384b53ab0fd58e74ec92c664ee4dff2b7aeaed4c.zip
(rmail-expunge-and-save): Let rmail-expunge show the message.
(rmail-quit): Mark summary unmodified. (rmail-expunge): Doc fix. Always show a message. (Bug#2763)
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/mail/rmail.el59
2 files changed, 44 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 57bddc721d6..13f68c6d6c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-04-07 Glenn Morris <rgm@gnu.org>
2
3 * mail/rmail.el (rmail-expunge-and-save): Let rmail-expunge show the
4 message.
5 (rmail-quit): Mark summary unmodified.
6 (rmail-expunge): Doc fix. Always show a message. (Bug#2763)
7
12009-04-07 Chong Yidong <cyd@stupidchicken.com> 82009-04-07 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * vc-bzr.el (vc-bzr-log-view-mode): Tweak 10 * vc-bzr.el (vc-bzr-log-view-mode): Tweak
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 4dfb7c8a1a2..dec4c07d6e7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1430,13 +1430,12 @@ If so restore the actual mbox message collection."
1430 "Expunge and save RMAIL file." 1430 "Expunge and save RMAIL file."
1431 (interactive) 1431 (interactive)
1432 (set-buffer rmail-buffer) 1432 (set-buffer rmail-buffer)
1433 (rmail-expunge t) 1433 (rmail-expunge)
1434 ;; No need to swap buffers: rmail-write-region-annotate takes care of it. 1434 ;; No need to swap buffers: rmail-write-region-annotate takes care of it.
1435 ;; (rmail-swap-buffers-maybe) 1435 ;; (rmail-swap-buffers-maybe)
1436 (save-buffer) 1436 (save-buffer)
1437 (if (rmail-summary-exists) 1437 (if (rmail-summary-exists)
1438 (rmail-select-summary (set-buffer-modified-p nil))) 1438 (rmail-select-summary (set-buffer-modified-p nil))))
1439 (rmail-show-message))
1440 1439
1441(defun rmail-quit () 1440(defun rmail-quit ()
1442 "Quit out of RMAIL. 1441 "Quit out of RMAIL.
@@ -1449,6 +1448,8 @@ Hook `rmail-quit-hook' is run after expunging."
1449 (run-hooks 'rmail-quit-hook)) 1448 (run-hooks 'rmail-quit-hook))
1450 ;; Don't switch to the summary buffer even if it was recently visible. 1449 ;; Don't switch to the summary buffer even if it was recently visible.
1451 (when rmail-summary-buffer 1450 (when rmail-summary-buffer
1451 (with-current-buffer rmail-summary-buffer
1452 (set-buffer-modified-p nil))
1452 (replace-buffer-in-windows rmail-summary-buffer) 1453 (replace-buffer-in-windows rmail-summary-buffer)
1453 (bury-buffer rmail-summary-buffer)) 1454 (bury-buffer rmail-summary-buffer))
1454 (if rmail-enable-mime 1455 (if rmail-enable-mime
@@ -3170,6 +3171,8 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given."
3170 "Return t if deleted message should be expunged. If necessary, ask the user. 3171 "Return t if deleted message should be expunged. If necessary, ask the user.
3171See also user-option `rmail-confirm-expunge'." 3172See also user-option `rmail-confirm-expunge'."
3172 (set-buffer rmail-buffer) 3173 (set-buffer rmail-buffer)
3174 ;; FIXME shouldn't this return nil if there is nothing to expunge?
3175 ;; Eg to save rmail-expunge wasting its time?
3173 (or (not (stringp rmail-deleted-vector)) 3176 (or (not (stringp rmail-deleted-vector))
3174 (not (string-match "D" rmail-deleted-vector)) 3177 (not (string-match "D" rmail-deleted-vector))
3175 (null rmail-confirm-expunge) 3178 (null rmail-confirm-expunge)
@@ -3260,31 +3263,43 @@ See also user-option `rmail-confirm-expunge'."
3260 (goto-char (+ (point-min) opoint)) 3263 (goto-char (+ (point-min) opoint))
3261 (goto-char (+ (point) opoint)))))) 3264 (goto-char (+ (point) opoint))))))
3262 3265
3266;; The DONT-SHOW argument is new in 23. Does not seem very important.
3263(defun rmail-expunge (&optional dont-show) 3267(defun rmail-expunge (&optional dont-show)
3264 "Erase deleted messages from Rmail file and summary buffer." 3268 "Erase deleted messages from Rmail file and summary buffer.
3269This always shows a message (so as not to leave the Rmail buffer
3270unswapped), and always updates any summary (so that it remains
3271consistent with the Rmail buffer). If DONT-SHOW is non-nil, it
3272does not pop any summary buffer."
3265 (interactive) 3273 (interactive)
3266 (when (rmail-expunge-confirmed) 3274 (when (rmail-expunge-confirmed)
3267 (let ((was-deleted (rmail-message-deleted-p rmail-current-message)) 3275 (let ((was-deleted (rmail-message-deleted-p rmail-current-message))
3268 (was-swapped (rmail-buffers-swapped-p))) 3276 (was-swapped (rmail-buffers-swapped-p)))
3269 (rmail-only-expunge t) 3277 (rmail-only-expunge t)
3270 (if dont-show 3278 ;; We always update the summary buffer, so that the contents
3271 ;; Do update the summary buffer, if any. 3279 ;; remain consistent with the rmail buffer.
3272 (let ((total rmail-total-messages)) 3280 ;; The only difference is, in the dont-show case, we use a
3273 (when (rmail-summary-exists) 3281 ;; cut-down version of rmail-select-summary that does not pop
3274 (with-current-buffer rmail-summary-buffer 3282 ;; the summary buffer. It's only used by rmail-quit, which is
3275 (let ((rmail-total-messages total)) 3283 ;; just going to bury any summary immediately after. If we made
3276 (rmail-update-summary))))) 3284 ;; rmail-quit bury the summary first, dont-show could be removed.
3277 ;; Update the summary and show it. 3285 ;; But the expunge might not be confirmed...
3278 (if (rmail-summary-exists) 3286 (if (rmail-summary-exists)
3279 (rmail-select-summary (rmail-update-summary))) 3287 (if dont-show
3280 ;; If we expunged the current message, a new one is current now, 3288 (let ((total rmail-total-messages))
3281 ;; so show it. If we weren't showing a message, show it. 3289 (with-current-buffer rmail-summary-buffer
3282 (if (or was-deleted (not was-swapped)) 3290 (let ((rmail-total-messages total))
3283 (rmail-show-message-1 rmail-current-message) 3291 (rmail-update-summary))))
3284 ;; Show the same message that was being shown before. 3292 (rmail-select-summary (rmail-update-summary))))
3285 (rmail-display-labels) 3293 ;; We always show a message, because (rmail-only-expunge t)
3286 (rmail-swap-buffers) 3294 ;; leaves the rmail buffer unswapped.
3287 (setq rmail-buffer-swapped t)))))) 3295 ;; If we expunged the current message, a new one is current now,
3296 ;; so show it. If we weren't showing a message, show it.
3297 (if (or was-deleted (not was-swapped))
3298 (rmail-show-message-1 rmail-current-message)
3299 ;; We can just show the same message that was being shown before.
3300 (rmail-display-labels)
3301 (rmail-swap-buffers)
3302 (setq rmail-buffer-swapped t)))))
3288 3303
3289;;;; *** Rmail Mailing Commands *** 3304;;;; *** Rmail Mailing Commands ***
3290 3305