* spam.el (spam-ham-copy-routine, spam-ham-move-routine)
authorTeodor Zlatanov <tzz@lifelogs.com>
Tue, 11 Nov 2003 20:08:24 +0000 (20:08 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Tue, 11 Nov 2003 20:08:24 +0000 (20:08 +0000)
(spam-mark-spam-as-expired-and-move-routine): allow for the
groups to be a list of a single item

* gnus.el (gnus-install-group-spam-parameters):
ham-process-destination and spam-process-destination allow lists now

lisp/ChangeLog
lisp/gnus.el
lisp/spam.el

index ab367c1..00bd968 100644 (file)
@@ -1,3 +1,12 @@
+2003-11-11  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-ham-copy-routine, spam-ham-move-routine)
+       (spam-mark-spam-as-expired-and-move-routine): allow for the
+       groups to be a list of a single item
+
+       * gnus.el (gnus-install-group-spam-parameters):
+       ham-process-destination and spam-process-destination allow lists now
+
 2003-11-10  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * message.el (message-insert-to): Do error out when the user
index f452b3d..42f839e 100644 (file)
@@ -1938,6 +1938,7 @@ spam processing, associated with the appropriate processor."
 
   (gnus-define-group-parameter
    spam-process-destination
+   :type list
    :parameter-type 
    '(choice :tag "Destination for spam-processed articles at summary exit"
            (string :tag "Move to a group")
@@ -1972,6 +1973,7 @@ mail groups."
   
   (gnus-define-group-parameter
    ham-process-destination
+   :type list
    :parameter-type 
    '(choice
      :tag "Destination for ham articles at summary exit from a spam group"
index 783cc2e..edba39f 100644 (file)
@@ -559,41 +559,43 @@ spamoracle database."
        (gnus-summary-mark-article article gnus-spam-mark)))))
 
 (defun spam-mark-spam-as-expired-and-move-routine (&rest groups)
-  (gnus-summary-kill-process-mark)
-  (let ((articles gnus-newsgroup-articles)
-       (backend-supports-deletions
-        (gnus-check-backend-function
-         'request-move-article gnus-newsgroup-name))
-       article tomove deletep)
-    (dolist (article articles)
-      (when (eq (gnus-summary-article-mark article) gnus-spam-mark)
-       (gnus-summary-mark-article article gnus-expirable-mark)
-       (push article tomove)))
+  (if (and groups (listp (car groups)))
+      (apply 'spam-mark-spam-as-expired-and-move-routine (car groups))
+    (gnus-summary-kill-process-mark)
+    (let ((articles gnus-newsgroup-articles)
+         (backend-supports-deletions
+          (gnus-check-backend-function
+           'request-move-article gnus-newsgroup-name))
+         article tomove deletep)
+      (dolist (article articles)
+       (when (eq (gnus-summary-article-mark article) gnus-spam-mark)
+         (gnus-summary-mark-article article gnus-expirable-mark)
+         (push article tomove)))
     
-    ;; now do the actual copies
-    (dolist (group groups)
-      (when (and tomove
-                (stringp group))
+      ;; now do the actual copies
+      (dolist (group groups)
+       (when (and tomove
+                  (stringp group))
+         (dolist (article tomove)
+           (gnus-summary-set-process-mark article))
+         (when tomove
+           (if (or (not backend-supports-deletions)
+                   (> (length groups) 1))
+               (progn 
+                 (gnus-summary-copy-article nil group)
+                 (setq deletep t))
+             (gnus-summary-move-article nil group)))))
+    
+      ;; now delete the articles, if there was a copy done, and the
+      ;; backend allows it
+      (when (and deletep backend-supports-deletions)
        (dolist (article tomove)
          (gnus-summary-set-process-mark article))
        (when tomove
-         (if (or (not backend-supports-deletions)
-               (> (length groups) 1))
-             (progn 
-               (gnus-summary-copy-article nil group)
-               (setq deletep t))
-           (gnus-summary-move-article nil group)))))
-    
-    ;; now delete the articles, if there was a copy done, and the
-    ;; backend allows it
-    (when (and deletep backend-supports-deletions)
-      (dolist (article tomove)
-       (gnus-summary-set-process-mark article))
-      (when tomove
-       (let ((gnus-novice-user nil))   ; don't ask me if I'm sure
-         (gnus-summary-delete-article nil))))
+         (let ((gnus-novice-user nil)) ; don't ask me if I'm sure
+           (gnus-summary-delete-article nil))))
     
-    (gnus-summary-yank-process-mark)))
+      (gnus-summary-yank-process-mark))))
  
 (defun spam-ham-copy-or-move-routine (copy groups)
   (gnus-summary-kill-process-mark)
@@ -636,10 +638,14 @@ spamoracle database."
   (gnus-summary-yank-process-mark))
  
 (defun spam-ham-copy-routine (&rest groups)
-  (spam-ham-copy-or-move-routine t groups))
+  (if (and groups (listp (car groups)))
+      (apply 'spam-ham-copy-routine (car groups))
+    (spam-ham-copy-or-move-routine t groups)))
  
 (defun spam-ham-move-routine (&rest groups)
-  (spam-ham-copy-or-move-routine nil groups))
+  (if (and groups (listp (car groups)))
+      (apply 'spam-ham-move-routine (car groups))
+    (spam-ham-copy-or-move-routine nil groups)))
  
 (defun spam-generic-register-routine (spam-func ham-func)
   (let ((articles gnus-newsgroup-articles)