(spam-mark-spam-as-expired-and-move-routine)
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 24 Oct 2003 15:39:33 +0000 (15:39 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 24 Oct 2003 15:39:33 +0000 (15:39 +0000)
(spam-ham-copy-or-move-routine): delete articles only if 1 or
more groups were specified (and "copy" was not specified for
spam-ham-copy-or-move-routine) (fixed twice)

lisp/ChangeLog
lisp/spam.el

index c44ea34..71026c8 100644 (file)
@@ -4,8 +4,8 @@
        is t, also don't intepret the list of groups as a list of lists
        (spam-mark-spam-as-expired-and-move-routine)
        (spam-ham-copy-or-move-routine): delete articles only if 1 or
-       more groups were specified (and "copy" was specified for
-       spam-ham-copy-or-move-routine)
+       more groups were specified (and "copy" was not specified for
+       spam-ham-copy-or-move-routine) (fixed twice)
 
 2003-10-24  Katsumi Yamaoka  <yamaoka@jpl.org>
 
index 38480e3..ed8fd03 100644 (file)
@@ -551,12 +551,12 @@ spamoracle database."
 (defun spam-mark-spam-as-expired-and-move-routine (&rest groups)
   (gnus-summary-kill-process-mark)
   (let ((articles gnus-newsgroup-articles)
-       article tomove)
+       article tomove todelete)
     (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
@@ -564,21 +564,22 @@ spamoracle database."
        (dolist (article tomove)
          (gnus-summary-set-process-mark article))
        (when tomove
-         (gnus-summary-copy-article nil group))))
-
-    ;; now delete the articles
-    (when (and (listp groups) (< 0 (length groups)))
+         (gnus-summary-copy-article nil group)
+         (setq todelete t))))
+    
+    ;; now delete the articles, if there was a copy done
+    (when todelete
       (dolist (article tomove)
        (gnus-summary-set-process-mark article))
       (when tomove
-       (gnus-summary-delete-article nil))))
-
-  (gnus-summary-yank-process-mark))
+       (gnus-summary-delete-article nil)))
+    
+    (gnus-summary-yank-process-mark)))
  
 (defun spam-ham-copy-or-move-routine (copy groups)
   (gnus-summary-kill-process-mark)
   (let ((articles gnus-newsgroup-articles)
-       article mark todo)
+       article mark todo todelete)
     (dolist (article articles)
       (when (spam-group-ham-mark-p gnus-newsgroup-name
                                   (gnus-summary-article-mark article))
@@ -586,16 +587,17 @@ spamoracle database."
 
     ;; now do the actual move
     (dolist (group groups)
-      (when todo
+      (when (and todo (stringp group))
        (dolist (article todo)
          (when spam-mark-ham-unread-before-move-from-spam-group
            (gnus-summary-mark-article article gnus-unread-mark))
          (gnus-summary-set-process-mark article))
-       (gnus-summary-copy-article nil group)))
+       (gnus-summary-copy-article nil group)
+       (setq todelete t)))
   
-    ;; now delete the articles, unless copy is t, and when there was a group
+    ;; now delete the articles, unless copy is t, and when there was a copy done
     (unless copy
-      (when (and (listp groups) (< 0 (length groups)))
+      (when todelete
        (dolist (article todo)
          (gnus-summary-set-process-mark article))
        (when todo