]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-spam-filter): Show a message rather than the raw mbox while prompting.
authorGlenn Morris <rgm@gnu.org>
Wed, 18 Feb 2009 08:01:56 +0000 (08:01 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 18 Feb 2009 08:01:56 +0000 (08:01 +0000)
lisp/mail/rmail-spam-filter.el

index 0b16965d9afabdf63c8c59e37e806b1862cfea1c..f6c2c81990487eebe2d2c8e88abe644f8f6743f3 100644 (file)
@@ -329,13 +329,20 @@ it from rmail file.  Called for each new message retrieved by
           ;; and delete the spam msg if needed:
           (let ((rmail-current-message msg) ; FIXME does this do anything?
                 (action (cdr (assq 'action
-                                   (nth num-element rsf-definitions-alist)))))
+                                   (nth num-element rsf-definitions-alist))))
+                (newfile (not (file-exists-p rsf-file))))
             ;; Check action item in rsf-definitions-alist and do it.
             (cond
              ((eq action 'output-and-delete)
-              ;; FIXME the prompt to write a new file leaves the raw
+              ;; Else the prompt to write a new file leaves the raw
               ;; mbox buffer visible.
+              (and newfile
+                   (rmail-show-message (rmail-first-unseen-message) 1))
               (rmail-output rsf-file)
+              ;; Swap back, else rmail-get-new-mail-1 gets confused.
+              (when newfile
+                (rmail-swap-buffers-maybe)
+                (widen))
               ;; Don't delete if automatic deletion after output is on.
               (or rmail-delete-after-output (rmail-delete-message)))
              ((eq action 'delete-spam)