Use 'set instead of 'add and 'delete to set backend marks.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 26 Nov 2010 02:01:52 +0000 (03:01 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 26 Nov 2010 02:01:52 +0000 (03:01 +0100)
lisp/ChangeLog
lisp/gnus-sum.el

index a00b31e..3af26f2 100644 (file)
@@ -1,5 +1,8 @@
 2010-11-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-sum.el (gnus-summary-push-marks-to-backend): Use 'set instead of
+       'add and 'delete to set backend marks.
+
        * nnmaildir.el (nnmaildir-request-set-mark): Be explicit about 'set.
 
        * nnheader.el (nnheader-update-marks-actions): Refactor out.
index f6c8d0f..2d679da 100644 (file)
@@ -9948,23 +9948,18 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
     (gnus-set-mode-line 'summary)))
 
 (defun gnus-summary-push-marks-to-backend (article)
-  (let ((add nil)
-       (delete nil)
+  (let ((set nil)
        (marks gnus-article-mark-lists))
-    (if (memq article gnus-newsgroup-unreads)
-       (push 'read add)
-      (push 'read delete))
+    (when (memq article gnus-newsgroup-unreads)
+      (push 'read set))
     (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)))
+      (when (and (eq (gnus-article-mark-to-type (cdar marks)) 'list)
+                (memq article (symbol-value
+                               (intern (format "gnus-newsgroup-%s"
+                                               (caar marks))))))
+       (push (cdar marks) set))
       (pop marks))
-    (gnus-request-set-mark gnus-newsgroup-name
-                          `(((,article) add ,add)
-                            ((,article) del ,delete)))))
+    (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)))))
 
 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
   "Copy the current article to some other group.