emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102521: nnml.el, nnfolder.el, nntp.e


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102521: nnml.el, nnfolder.el, nntp.el (*-request-set-mark): Extend syntax with 'set.
Date: Fri, 26 Nov 2010 02:11:40 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102521
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2010-11-26 02:11:40 +0000
message:
  nnml.el, nnfolder.el, nntp.el (*-request-set-mark): Extend syntax with 'set.
  nnheader.el, nntp.el, nnfolder.el, nnml.el (*-request-set-mark): Refactor out 
nnheader-update-marks-actions and use it throughout.
  nnmaildir.el (nnmaildir-request-set-mark): Be explicit about 'set.
  gnus-sum.el (gnus-summary-push-marks-to-backend): Use 'set instead of 'add 
and 'delete to set backend marks.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-sum.el
  lisp/gnus/nnfolder.el
  lisp/gnus/nnheader.el
  lisp/gnus/nnimap.el
  lisp/gnus/nnmaildir.el
  lisp/gnus/nnml.el
  lisp/gnus/nntp.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-11-26 01:27:37 +0000
+++ b/lisp/gnus/ChangeLog       2010-11-26 02:11:40 +0000
@@ -1,5 +1,18 @@
 2010-11-26  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * 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.
+
+       * nntp.el (nntp-request-set-mark): Use it.
+
+       * nnfolder.el (nnfolder-request-set-mark): Ditto.
+
+       * nnml.el (nnml-request-set-mark): Ditto.
+
        * nnimap.el (nnimap-last-response-string): Remove the unfolding -- it
        introduces regressions in article selection.
        (nnimap-find-uid-response): New function.
@@ -7,6 +20,13 @@
        (nnimap-request-move-article): Use the UID returned, if any.
        (nnimap-get-groups): Reimplement to work with folded lines.
        (nnimap-find-uid-response): The UID is the last element in the list.
+       (nnimap-request-set-mark): Extend syntax with 'set.
+
+       * nnml.el (nnml-request-set-mark): Ditto.
+
+       * nnfolder.el (nnfolder-request-set-mark): Ditto.
+
+       * nntp.el (nntp-request-set-mark): Ditto.
 
 2010-11-25  Katsumi Yamaoka  <address@hidden>
 

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2010-11-25 11:14:14 +0000
+++ b/lisp/gnus/gnus-sum.el     2010-11-26 02:11:40 +0000
@@ -9948,23 +9948,18 @@
     (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.

=== modified file 'lisp/gnus/nnfolder.el'
--- a/lisp/gnus/nnfolder.el     2010-10-11 23:29:33 +0000
+++ b/lisp/gnus/nnfolder.el     2010-11-26 02:11:40 +0000
@@ -1186,19 +1186,7 @@
     (nnfolder-open-server server))
   (unless nnfolder-marks-is-evil
     (nnfolder-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-           (what  (nth 1 action))
-           (marks (nth 2 action)))
-       (assert (or (eq what 'add) (eq what 'del)) nil
-               "Unknown request-set-mark action: %s" what)
-       (dolist (mark marks)
-         (setq nnfolder-marks (gnus-update-alist-soft
-                           mark
-                           (funcall (if (eq what 'add) 'gnus-range-add
-                                      'gnus-remove-from-range)
-                                    (cdr (assoc mark nnfolder-marks)) range)
-                           nnfolder-marks)))))
+    (setq nnfolder-marks (nnheader-update-marks-actions nnfolder-marks 
actions))
     (nnfolder-save-marks group server))
   nil)
 

=== modified file 'lisp/gnus/nnheader.el'
--- a/lisp/gnus/nnheader.el     2010-11-23 22:24:15 +0000
+++ b/lisp/gnus/nnheader.el     2010-11-26 02:11:40 +0000
@@ -1078,6 +1078,26 @@
                   (truncate nnheader-read-timeout))
                1000))))
 
+(defun nnheader-update-marks-actions (backend-marks actions)
+  (dolist (action actions)
+    (let ((range (nth 0 action))
+         (what  (nth 1 action))
+         (marks (nth 2 action)))
+      (dolist (mark marks)
+       (setq backend-marks
+             (gnus-update-alist-soft
+              mark
+              (cond
+               ((eq what 'add)
+                (gnus-range-add (cdr (assoc mark backend-marks)) range)
+                ((eq what 'del)
+                 (gnus-remove-from-range
+                  (cdr (assoc mark backend-marks)) range))
+                ((eq what 'set)
+                 range)))
+              backend-marks)))))
+  backend-marks)
+
 (when (featurep 'xemacs)
   (require 'nnheaderxm))
 

=== modified file 'lisp/gnus/nnimap.el'
--- a/lisp/gnus/nnimap.el       2010-11-26 01:27:37 +0000
+++ b/lisp/gnus/nnimap.el       2010-11-26 02:11:40 +0000
@@ -941,9 +941,10 @@
                (setq sequence (nnimap-send-command
                                "UID STORE %s %sFLAGS.SILENT (%s)"
                                (nnimap-article-ranges range)
-                               (if (eq action 'del)
-                                   "-"
-                                 "+")
+                               (cond
+                                ((eq action 'del) "-")
+                                ((eq action 'add) "-")
+                                ((eq action 'set) ""))
                                (mapconcat #'identity flags " ")))))))
        ;; Wait for the last command to complete to avoid later
        ;; syncronisation problems with the stream.

=== modified file 'lisp/gnus/nnmaildir.el'
--- a/lisp/gnus/nnmaildir.el    2010-10-11 23:29:33 +0000
+++ b/lisp/gnus/nnmaildir.el    2010-11-26 02:11:40 +0000
@@ -1590,7 +1590,7 @@
        (nnmaildir--nlist-iterate nlist ranges
                                  (cond ((eq 'del (cadr action)) del-action)
                                        ((eq 'add (cadr action)) add-action)
-                                       (t set-action))))
+                                       ((eq 'set (cadr action)) set-action))))
       nil)))
 
 (defun nnmaildir-close-group (gname &optional server)

=== modified file 'lisp/gnus/nnml.el'
--- a/lisp/gnus/nnml.el 2010-09-26 13:25:35 +0000
+++ b/lisp/gnus/nnml.el 2010-11-26 02:11:40 +0000
@@ -1033,19 +1033,7 @@
   (nnml-possibly-change-directory group server)
   (unless nnml-marks-is-evil
     (nnml-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-           (what  (nth 1 action))
-           (marks (nth 2 action)))
-       (assert (or (eq what 'add) (eq what 'del)) nil
-               "Unknown request-set-mark action: %s" what)
-       (dolist (mark marks)
-         (setq nnml-marks (gnus-update-alist-soft
-                           mark
-                           (funcall (if (eq what 'add) 'gnus-range-add
-                                      'gnus-remove-from-range)
-                                    (cdr (assoc mark nnml-marks)) range)
-                           nnml-marks)))))
+    (setq nnml-marks (nnheader-update-marks-actions nnml-marks actions))
     (nnml-save-marks group server))
   nil)
 

=== modified file 'lisp/gnus/nntp.el'
--- a/lisp/gnus/nntp.el 2010-11-01 06:13:43 +0000
+++ b/lisp/gnus/nntp.el 2010-11-26 02:11:40 +0000
@@ -1118,19 +1118,7 @@
             nntp-marks-file-name)
     (nntp-possibly-create-directory group server)
     (nntp-open-marks group server)
-    (dolist (action actions)
-      (let ((range (nth 0 action))
-           (what  (nth 1 action))
-           (marks (nth 2 action)))
-       (assert (or (eq what 'add) (eq what 'del)) nil
-               "Unknown request-set-mark action: %s" what)
-       (dolist (mark marks)
-         (setq nntp-marks (gnus-update-alist-soft
-                           mark
-                           (funcall (if (eq what 'add) 'gnus-range-add
-                                      'gnus-remove-from-range)
-                                    (cdr (assoc mark nntp-marks)) range)
-                           nntp-marks)))))
+    (setq nntp-marks (nnheader-update-marks-actions nntp-marks actions))
     (nntp-save-marks group server))
   nil)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]