+2010-11-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * nnimap.el (nnimap-request-move-article): It's no longer necessary to
+ clear marks before moving, since they're synced from the Gnus side
+ first.
+
+ * gnus-sum.el (gnus-summary-push-marks-to-backend): New function.
+ (gnus-summary-move-article): Copy over all marks before moving, so that
+ IMAP doesn't think a new article has arrived.
+
2010-11-24 Julien Danjou <julien@danjou.info>
* message.el (message-goto-body): Use called-interactively-p.
articles)
(while articles
(setq article (pop articles))
+ ;; Set any marks that may have changed in the summary buffer.
+ (when gnus-preserve-marks
+ (gnus-summary-push-marks-to-backend article))
(let ((gnus-newsgroup-original-name gnus-newsgroup-name)
(gnus-article-original-subject
(mail-header-subject
(gnus-summary-position-point)
(gnus-set-mode-line 'summary)))
+(defun gnus-summary-push-marks-to-backend (article)
+ (let ((add nil)
+ (delete nil)
+ (marks gnus-article-mark-lists))
+ (if (memq article gnus-newsgroup-unreads)
+ (push 'read add)
+ (push 'read delete))
+ (while marks
+ (when (eq (gnus-article-mark-to-type (cdar marks)) 'list)
+ (if (memq article (symbol-value
+ (intern (format "gnus-newsgroup-%s"
+ (caar marks)))))
+ (push (cdar marks) add)
+ (push (cdar marks) delete)))
+ (pop marks))
+ (gnus-request-set-mark gnus-newsgroup-name
+ `(((,article) add ,add)
+ ((,article) del ,delete)))))
+
(defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
"Copy the current article to some other group.
If TO-NEWSGROUP is string, do not prompt for a newsgroup to copy to.
(if internal-move-group
(let ((result
(with-current-buffer (nnimap-buffer)
- ;; Clear all flags before moving.
- (nnimap-send-command "UID STORE %d FLAGS.SILENT ()"
- article)
(nnimap-command "UID COPY %d %S"
article
(utf7-encode internal-move-group t)))))