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>
(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
(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))
;; 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