+ ;; first, mark the article with the process mark and, if needed,
+ ;; the unread or expired mark (for ham and spam respectively)
+ (dolist (article articles)
+ (when (and (eq classification 'ham)
+ spam-mark-ham-unread-before-move-from-spam-group)
+ (gnus-message 9 "Marking ham article %d unread before move"
+ article)
+ (gnus-summary-mark-article article gnus-unread-mark))
+ (when (and (eq classification 'spam)
+ (not copy))
+ (gnus-message 9 "Marking spam article %d expirable before move"
+ article)
+ (gnus-summary-mark-article article gnus-expirable-mark))
+ (gnus-summary-set-process-mark article)
+
+ (if respool ; respooling is with a "fake" group
+ (let ((spam-split-disabled
+ (or spam-split-disabled
+ (and (eq classification 'ham)
+ spam-disable-spam-split-during-ham-respool))))
+ (gnus-message 9 "Respooling article %d with method %s"
+ article respool-method)
+ (gnus-summary-respool-article nil respool-method))
+ ;; else, we are not respooling
+ (if (or (not backend-supports-deletions)
+ (> (length groups) 1))
+ (progn ; if copying, copy and set deletep
+ (gnus-message 9 "Copying article %d to group %s"
+ article group)
+ (gnus-summary-copy-article nil group)
+ (setq deletep t))
+ (gnus-message 9 "Moving article %d to group %s"
+ article group)
+ (gnus-summary-move-article nil group)))))) ; else move articles
+
+ ;; now delete the articles, unless a) copy is t, and there was a copy done
+ ;; b) a move was done to a single group
+ ;; c) backend-supports-deletions is nil
+ (unless copy
+ (when (and deletep backend-supports-deletions)