From e9541c1e6b835ae8e1029ec86c784a9282ddb484 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Fri, 18 Apr 2003 17:51:31 +0000 Subject: [PATCH] (spam-mark-only-unseen-as-spam): new parameter, see doc (spam-mark-junk-as-spam-routine): use spam-mark-only-unseen-as-spam, simplify routine to take advantage of gnus-newsgroup-unread as well as gnus-newsgroup-unseen --- lisp/ChangeLog | 4 ++++ lisp/spam.el | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e1a03f096..593849c1c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,10 @@ * spam.el (spam-split): allow a particular check as a parameter, e.g. (: spam-split 'spam-use-bogofilter) + (spam-mark-only-unseen-as-spam): new parameter, see doc + (spam-mark-junk-as-spam-routine): use + spam-mark-only-unseen-as-spam, simplify routine to take advantage + of gnus-newsgroup-unread as well as gnus-newsgroup-unseen 2003-04-17 Teodor Zlatanov diff --git a/lisp/spam.el b/lisp/spam.el index 6cbbc1f59..602e69617 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -75,6 +75,14 @@ When nil, only ham and unclassified groups will have their spam moved to the spam-process-destination. When t, spam will also be moved from spam groups." + :type 'repeat (choice + :group 'spam) + +(defcustom spam-mark-only-unseen-as-spam t + "Whether only unseen articles should be marked as spam in spam +groups. When nil, all unread articles in a spam group are marked as +spam. Set this if you want to leave an article unread in a spam group +without losing it to the automatic spam-marking process." :type 'boolean :group 'spam) @@ -452,13 +460,15 @@ your main source of newsgroup names." ;; check the global list of group names spam-junk-mailgroups and the ;; group parameters (when (spam-group-spam-contents-p gnus-newsgroup-name) - (gnus-message 5 "Marking unread articles as spam") - (let ((articles gnus-newsgroup-articles) - article) - (while articles - (setq article (pop articles)) - (when (eq (gnus-summary-article-mark article) gnus-unread-mark) - (gnus-summary-mark-article article gnus-spam-mark)))))) + (gnus-message 5 "Marking %s articles as spam" + (if spam-mark-only-unseen-as-spam + "unseen" + "unread")) + (let ((articles (if spam-mark-only-unseen-as-spam + gnus-newsgroup-unseen + gnus-newsgroup-unreads))) + (dolist (article articles) + (gnus-summary-mark-article article gnus-spam-mark))))) (defun spam-mark-spam-as-expired-and-move-routine (&optional group) (gnus-summary-kill-process-mark) -- 2.34.1