(spam-mark-only-unseen-as-spam): new parameter, see doc
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 18 Apr 2003 17:51:31 +0000 (17:51 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 18 Apr 2003 17:51:31 +0000 (17:51 +0000)
(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
lisp/spam.el

index e1a03f0..593849c 100644 (file)
@@ -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  <tzz@lifelogs.com>
 
index 6cbbc1f..602e696 100644 (file)
 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)