It's no longer necessary to clear marks before moving, since they're synced from...
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 24 Nov 2010 22:03:25 +0000 (23:03 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 24 Nov 2010 22:03:25 +0000 (23:03 +0100)
lisp/ChangeLog
lisp/gnus-sum.el
lisp/nnimap.el

index 67a0835..80d2244 100644 (file)
@@ -1,3 +1,13 @@
+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.
index 4e4fc5b..4858448 100644 (file)
@@ -9705,6 +9705,9 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
                  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
@@ -9921,6 +9924,25 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
     (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.
index f6315a5..86bba98 100644 (file)
@@ -783,9 +783,6 @@ textual parts.")
        (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)))))