(spam-ham-marks, spam-spam-marks): changed list
authorTeodor Zlatanov <tzz@lifelogs.com>
Wed, 1 Jan 2003 21:26:54 +0000 (21:26 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Wed, 1 Jan 2003 21:26:54 +0000 (21:26 +0000)
customization and list itself to store mark symbol rather than
mark character.
(spam-bogofilter-register-routine): added logic to generate mark
values list from spam-ham-marks and spam-spam-marks, so (member)
would work.

lisp/ChangeLog
lisp/spam.el

index 64adeb3..cb4f1d2 100644 (file)
@@ -1,3 +1,12 @@
+2003-01-01  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-ham-marks, spam-spam-marks): changed list
+       customization and list itself to store mark symbol rather than
+       mark character.
+       (spam-bogofilter-register-routine): added logic to generate mark
+       values list from spam-ham-marks and spam-spam-marks, so (member)
+       would work.
+
 2003-01-01  Raymond Scholz  <ray-2002@zonix.de>
 
        * message.el (message-signature-insert-empty-line): New variable. 
index 34a9a21..a8d02a0 100644 (file)
@@ -36,6 +36,8 @@
 
 (require 'gnus-sum)
 
+(require 'gnus-uu)                     ; because of key prefix issues
+
 ;; FIXME!  We should not require `message' until we actually need
 ;; them.  Best would be to declare needed functions as auto-loadable.
 (require 'message)
@@ -140,16 +142,25 @@ All unmarked article in such group receive the spam mark on group entry."
   :type '(repeat (string :tag "Server"))
   :group 'spam)
 
-(defcustom spam-ham-marks (list gnus-del-mark gnus-read-mark gnus-killed-mark gnus-kill-file-mark gnus-low-score-mark)
+(defcustom spam-ham-marks (list 'gnus-del-mark 'gnus-read-mark 'gnus-killed-mark 'gnus-kill-file-mark 'gnus-low-score-mark)
   "Marks considered as being ham (positively not spam).
 Such articles will be processed as ham (non-spam) on group exit."
-  :type '(repeat (character :tag "Mark"))
+  :type '(set
+         (variable-item gnus-del-mark)
+         (variable-item gnus-read-mark)
+         (variable-item gnus-killed-mark)
+         (variable-item gnus-kill-file-mark)
+         (variable-item gnus-low-score-mark))
   :group 'spam)
 
-(defcustom spam-spam-marks (list gnus-spam-mark)
+(defcustom spam-spam-marks (list 'gnus-spam-mark)
   "Marks considered as being spam (positively spam).
 Such articles will be transmitted to `bogofilter -s' on group exit."
-  :type '(repeat (character :tag "Mark"))
+  :type '(set 
+         (variable-item gnus-spam-mark)
+         (variable-item gnus-killed-mark)
+         (variable-item gnus-kill-file-mark)
+         (variable-item gnus-low-score-mark))
   :group 'spam)
 
 (defcustom spam-face 'gnus-splash-face
@@ -516,13 +527,21 @@ spamicity coefficient of each, and the overall article spamicity."
 (defun spam-bogofilter-register-routine ()
   (when (and spam-use-bogofilter spam-bogofilter-path)
     (let ((articles gnus-newsgroup-articles)
-         article mark ham-articles spam-articles)
+         article mark ham-articles spam-articles spam-mark-values ham-mark-values)
+
+      ;; marks are stored as symbolic values, so we have to dereference them for memq to work
+      (dolist (mark spam-ham-marks)
+       (push (symbol-value mark) ham-mark-values))
+
+      (dolist (mark spam-spam-marks)
+       (push (symbol-value mark) spam-mark-values))
+
       (while articles
        (setq article (pop articles)
              mark (gnus-summary-article-mark article))
-       (cond ((memq mark spam-spam-marks) (push article spam-articles))
+       (cond ((memq mark spam-mark-values) (push article spam-articles))
              ((memq article gnus-newsgroup-saved))
-             ((memq mark spam-ham-marks) (push article ham-articles))))
+             ((memq mark ham-mark-values) (push article ham-articles))))
       (when ham-articles
        (spam-bogofilter-articles "ham" "-n" ham-articles))
       (when spam-articles