changeset 102097:a07976575a49

(rmail-get-new-mail-filter-spam): Show a message rather than the raw mbox while prompting.
author Glenn Morris <rgm@gnu.org>
date Wed, 18 Feb 2009 08:02:56 +0000
parents 7053d753a548
children 20b70d069bfd
files lisp/ChangeLog lisp/mail/rmail.el
diffstat 2 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 18 08:01:56 2009 +0000
+++ b/lisp/ChangeLog	Wed Feb 18 08:02:56 2009 +0000
@@ -1,3 +1,9 @@
+2009-02-18  Glenn Morris  <rgm@gnu.org>
+
+	* mail/rmail.el (rmail-get-new-mail-filter-spam):
+	* mail/rmail-spam-filter.el (rmail-spam-filter):
+	Show a message rather than the raw mbox while prompting.
+
 2009-02-18  Martin Rudalics  <rudalics@gmx.at>
 
 	* progmodes/flymake.el (flymake): Add defgroup.  (Bug#2356)
--- a/lisp/mail/rmail.el	Wed Feb 18 08:01:56 2009 +0000
+++ b/lisp/mail/rmail.el	Wed Feb 18 08:02:56 2009 +0000
@@ -1710,8 +1710,8 @@
 	(message "%d new message%s read%s" new-messages suffix blurb)
 	(unless (string-equal blurb "") ; there was spam
 	  (if rsf-beep (beep t))
-	  ;; FIXME This doesn't seem a very good feature, e.g. it delays the
-	  ;; appearance of the summary, and leaves the raw buffer visible.
+	  ;; The use of rmail-show-message in rmail-get-new-mail-filter-spam
+	  ;; also prevents the raw mbox buffer from showing at this point.
 	  (sleep-for rsf-sleep-after-message))
 	;; Establish the return value.
 	(setq result (> new-messages 0))
@@ -1726,12 +1726,13 @@
       (or (rmail-spam-filter nscan)
 	  (setq nspam (1+ nspam)))
       (setq nscan (1+ nscan)))
-    ;; FIXME the expunge prompt leaves the raw mbox buffer showing,
-    ;; but it's not straightforward to show a message at this point
-    ;; without messing up the rest of get-new-mail.
-    (and (> nspam 0)
-	 (rmail-expunge-confirmed)
-	 (rmail-only-expunge t))
+    (when (> nspam 0)
+      ;; Otherwise the expunge prompt leaves the raw mbox buffer showing.
+      (rmail-show-message (rmail-first-unseen-message) 1)
+      (if (rmail-expunge-confirmed) (rmail-only-expunge t))
+      ;; Swap back, else get-new-mail-1 gets confused.
+      (rmail-swap-buffers-maybe)
+      (widen))
     ;; Return a message based on the number of spam messages found.
     (cond
      ((zerop nspam) "")