From adba61ff8e8cb3dc9a4a267c01faedfba04e8e75 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Mon, 17 May 2004 14:28:21 +0000 Subject: [PATCH] (spam-summary-prepare-exit): fix messages, so they show only when there is spam or ham to be processed --- lisp/ChangeLog | 5 +++++ lisp/spam.el | 36 +++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 608d4866c..02ca1d544 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-05-17 Teodor Zlatanov + + * spam.el (spam-summary-prepare-exit): fix messages, so they show + only when there is spam or ham to be processed + 2004-05-17 Lars Magne Ingebrigtsen * mail-source.el (mail-source-delete-crash-box): Refactor. diff --git a/lisp/spam.el b/lisp/spam.el index 8fc286d19..a9099ace2 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -861,11 +861,14 @@ Will not return a nil score." (unless (and spam-move-spam-nonspam-groups-only (spam-group-spam-contents-p gnus-newsgroup-name)) - (gnus-message 6 "Marking spam as expired and moving it to %s" - (gnus-parameter-spam-process-destination - gnus-newsgroup-name)) - (spam-mark-spam-as-expired-and-move-routine - (gnus-parameter-spam-process-destination gnus-newsgroup-name))) + (when (< 0 (length (spam-list-articles + gnus-newsgroup-articles + 'spam))) + (gnus-message 6 "Marking spam as expired and moving it to %s" + (gnus-parameter-spam-process-destination + gnus-newsgroup-name)) + (spam-mark-spam-as-expired-and-move-routine + (gnus-parameter-spam-process-destination gnus-newsgroup-name)))) ;; now we redo spam-mark-spam-as-expired-and-move-routine to only ;; expire spam, in case the above did not expire them @@ -888,16 +891,19 @@ Will not return a nil score." (spam-group-processor-p gnus-newsgroup-name processor)) (spam-register-routine classification check))))) - (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) - (gnus-message 6 "Copying ham") - (spam-ham-copy-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name))) - - ;; now move all ham articles out of spam groups - (when (spam-group-spam-contents-p gnus-newsgroup-name) - (gnus-message 6 "Moving ham messages from spam group") - (spam-ham-move-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name)))) + (when (< 0 (length (spam-list-articles + gnus-newsgroup-articles + 'ham))) + (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) + (gnus-message 6 "Copying ham") + (spam-ham-copy-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name))) + + ;; now move all ham articles out of spam groups + (when (spam-group-spam-contents-p gnus-newsgroup-name) + (gnus-message 6 "Moving ham messages from spam group") + (spam-ham-move-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name))))) (setq spam-old-ham-articles nil) (setq spam-old-spam-articles nil)) -- 2.25.1