(spam-split): allow a particular check as a parameter,
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 18 Apr 2003 04:03:58 +0000 (04:03 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 18 Apr 2003 04:03:58 +0000 (04:03 +0000)
e.g. (: spam-split 'spam-use-bogofilter)

lisp/ChangeLog
lisp/spam.el

index 9492a9a..e1a03f0 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-18  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-split): allow a particular check as a parameter,
+       e.g. (: spam-split 'spam-use-bogofilter)
+
 2003-04-17  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus.el (gnus-group-short-name, gnus-group-prefixed-p): new functions
index fe437d3..6cbbc1f 100644 (file)
@@ -599,10 +599,10 @@ definitely a spam.")
 "The spam-list-of-statistical-checks list contains all the mail
 splitters that need to have the full message body available.")
 
-(defun spam-split ()
+(defun spam-split (&rest specific-checks)
   "Split this message into the `spam' group if it is spam.
 This function can be used as an entry in `nnmail-split-fancy', for
-example like this: (: spam-split)
+example like this: (: spam-split).  It can take checks as parameters.
 
 See the Info node `(gnus)Fancy Mail Splitting' for more details."
   (interactive)
@@ -619,7 +619,9 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
            decision)
        (while (and list-of-checks (not decision))
          (let ((pair (pop list-of-checks)))
-           (when (symbol-value (car pair))
+           (when (and (symbol-value (car pair))
+                      (or (null specific-checks)
+                          (memq (car pair) specific-checks)))
              (gnus-message 5 "spam-split: calling the %s function" (symbol-name (cdr pair)))
              (setq decision (funcall (cdr pair))))))
        (if (eq decision t)