aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-11-26 02:11:40 +0000
committerKatsumi Yamaoka2010-11-26 02:11:40 +0000
commit5f285722b63bc4a5f67c03a5bffb659ef65e7a14 (patch)
tree10c4532473f35fa24a588f642c5f8f67cffb80ea
parent17dd22813f2fbf929a6e8e75966d097a6f4a2334 (diff)
downloademacs-5f285722b63bc4a5f67c03a5bffb659ef65e7a14.tar.gz
emacs-5f285722b63bc4a5f67c03a5bffb659ef65e7a14.zip
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.
-rw-r--r--lisp/gnus/ChangeLog20
-rw-r--r--lisp/gnus/gnus-sum.el23
-rw-r--r--lisp/gnus/nnfolder.el14
-rw-r--r--lisp/gnus/nnheader.el20
-rw-r--r--lisp/gnus/nnimap.el7
-rw-r--r--lisp/gnus/nnmaildir.el2
-rw-r--r--lisp/gnus/nnml.el14
-rw-r--r--lisp/gnus/nntp.el14
8 files changed, 57 insertions, 57 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 7769a9c6131..2705413d2c8 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,18 @@
12010-11-26 Lars Magne Ingebrigtsen <larsi@gnus.org> 12010-11-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * gnus-sum.el (gnus-summary-push-marks-to-backend): Use 'set instead of
4 'add and 'delete to set backend marks.
5
6 * nnmaildir.el (nnmaildir-request-set-mark): Be explicit about 'set.
7
8 * nnheader.el (nnheader-update-marks-actions): Refactor out.
9
10 * nntp.el (nntp-request-set-mark): Use it.
11
12 * nnfolder.el (nnfolder-request-set-mark): Ditto.
13
14 * nnml.el (nnml-request-set-mark): Ditto.
15
3 * nnimap.el (nnimap-last-response-string): Remove the unfolding -- it 16 * nnimap.el (nnimap-last-response-string): Remove the unfolding -- it
4 introduces regressions in article selection. 17 introduces regressions in article selection.
5 (nnimap-find-uid-response): New function. 18 (nnimap-find-uid-response): New function.
@@ -7,6 +20,13 @@
7 (nnimap-request-move-article): Use the UID returned, if any. 20 (nnimap-request-move-article): Use the UID returned, if any.
8 (nnimap-get-groups): Reimplement to work with folded lines. 21 (nnimap-get-groups): Reimplement to work with folded lines.
9 (nnimap-find-uid-response): The UID is the last element in the list. 22 (nnimap-find-uid-response): The UID is the last element in the list.
23 (nnimap-request-set-mark): Extend syntax with 'set.
24
25 * nnml.el (nnml-request-set-mark): Ditto.
26
27 * nnfolder.el (nnfolder-request-set-mark): Ditto.
28
29 * nntp.el (nntp-request-set-mark): Ditto.
10 30
112010-11-25 Katsumi Yamaoka <yamaoka@jpl.org> 312010-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
12 32
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f6c8d0f8f4a..2d679dab246 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -9948,23 +9948,18 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9948 (gnus-set-mode-line 'summary))) 9948 (gnus-set-mode-line 'summary)))
9949 9949
9950(defun gnus-summary-push-marks-to-backend (article) 9950(defun gnus-summary-push-marks-to-backend (article)
9951 (let ((add nil) 9951 (let ((set nil)
9952 (delete nil)
9953 (marks gnus-article-mark-lists)) 9952 (marks gnus-article-mark-lists))
9954 (if (memq article gnus-newsgroup-unreads) 9953 (when (memq article gnus-newsgroup-unreads)
9955 (push 'read add) 9954 (push 'read set))
9956 (push 'read delete))
9957 (while marks 9955 (while marks
9958 (when (eq (gnus-article-mark-to-type (cdar marks)) 'list) 9956 (when (and (eq (gnus-article-mark-to-type (cdar marks)) 'list)
9959 (if (memq article (symbol-value 9957 (memq article (symbol-value
9960 (intern (format "gnus-newsgroup-%s" 9958 (intern (format "gnus-newsgroup-%s"
9961 (caar marks))))) 9959 (caar marks))))))
9962 (push (cdar marks) add) 9960 (push (cdar marks) set))
9963 (push (cdar marks) delete)))
9964 (pop marks)) 9961 (pop marks))
9965 (gnus-request-set-mark gnus-newsgroup-name 9962 (gnus-request-set-mark gnus-newsgroup-name `(((,article) set ,set)))))
9966 `(((,article) add ,add)
9967 ((,article) del ,delete)))))
9968 9963
9969(defun gnus-summary-copy-article (&optional n to-newsgroup select-method) 9964(defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
9970 "Copy the current article to some other group. 9965 "Copy the current article to some other group.
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 668b75a7838..5de8653948f 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -1186,19 +1186,7 @@ This command does not work if you use short group names."
1186 (nnfolder-open-server server)) 1186 (nnfolder-open-server server))
1187 (unless nnfolder-marks-is-evil 1187 (unless nnfolder-marks-is-evil
1188 (nnfolder-open-marks group server) 1188 (nnfolder-open-marks group server)
1189 (dolist (action actions) 1189 (setq nnfolder-marks (nnheader-update-marks-actions nnfolder-marks actions))
1190 (let ((range (nth 0 action))
1191 (what (nth 1 action))
1192 (marks (nth 2 action)))
1193 (assert (or (eq what 'add) (eq what 'del)) nil
1194 "Unknown request-set-mark action: %s" what)
1195 (dolist (mark marks)
1196 (setq nnfolder-marks (gnus-update-alist-soft
1197 mark
1198 (funcall (if (eq what 'add) 'gnus-range-add
1199 'gnus-remove-from-range)
1200 (cdr (assoc mark nnfolder-marks)) range)
1201 nnfolder-marks)))))
1202 (nnfolder-save-marks group server)) 1190 (nnfolder-save-marks group server))
1203 nil) 1191 nil)
1204 1192
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 08dc96d945b..d34229a467d 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -1078,6 +1078,26 @@ See `find-file-noselect' for the arguments."
1078 (truncate nnheader-read-timeout)) 1078 (truncate nnheader-read-timeout))
1079 1000)))) 1079 1000))))
1080 1080
1081(defun nnheader-update-marks-actions (backend-marks actions)
1082 (dolist (action actions)
1083 (let ((range (nth 0 action))
1084 (what (nth 1 action))
1085 (marks (nth 2 action)))
1086 (dolist (mark marks)
1087 (setq backend-marks
1088 (gnus-update-alist-soft
1089 mark
1090 (cond
1091 ((eq what 'add)
1092 (gnus-range-add (cdr (assoc mark backend-marks)) range)
1093 ((eq what 'del)
1094 (gnus-remove-from-range
1095 (cdr (assoc mark backend-marks)) range))
1096 ((eq what 'set)
1097 range)))
1098 backend-marks)))))
1099 backend-marks)
1100
1081(when (featurep 'xemacs) 1101(when (featurep 'xemacs)
1082 (require 'nnheaderxm)) 1102 (require 'nnheaderxm))
1083 1103
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 97889bb0a64..0a0b413d3d2 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -941,9 +941,10 @@ textual parts.")
941 (setq sequence (nnimap-send-command 941 (setq sequence (nnimap-send-command
942 "UID STORE %s %sFLAGS.SILENT (%s)" 942 "UID STORE %s %sFLAGS.SILENT (%s)"
943 (nnimap-article-ranges range) 943 (nnimap-article-ranges range)
944 (if (eq action 'del) 944 (cond
945 "-" 945 ((eq action 'del) "-")
946 "+") 946 ((eq action 'add) "-")
947 ((eq action 'set) ""))
947 (mapconcat #'identity flags " "))))))) 948 (mapconcat #'identity flags " ")))))))
948 ;; Wait for the last command to complete to avoid later 949 ;; Wait for the last command to complete to avoid later
949 ;; syncronisation problems with the stream. 950 ;; syncronisation problems with the stream.
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 97531f87666..65f33411297 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -1590,7 +1590,7 @@ by nnmaildir-request-article.")
1590 (nnmaildir--nlist-iterate nlist ranges 1590 (nnmaildir--nlist-iterate nlist ranges
1591 (cond ((eq 'del (cadr action)) del-action) 1591 (cond ((eq 'del (cadr action)) del-action)
1592 ((eq 'add (cadr action)) add-action) 1592 ((eq 'add (cadr action)) add-action)
1593 (t set-action)))) 1593 ((eq 'set (cadr action)) set-action))))
1594 nil))) 1594 nil)))
1595 1595
1596(defun nnmaildir-close-group (gname &optional server) 1596(defun nnmaildir-close-group (gname &optional server)
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index b84ce518a28..46a6d903f7e 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -1033,19 +1033,7 @@ Use the nov database for the current group if available."
1033 (nnml-possibly-change-directory group server) 1033 (nnml-possibly-change-directory group server)
1034 (unless nnml-marks-is-evil 1034 (unless nnml-marks-is-evil
1035 (nnml-open-marks group server) 1035 (nnml-open-marks group server)
1036 (dolist (action actions) 1036 (setq nnml-marks (nnheader-update-marks-actions nnml-marks actions))
1037 (let ((range (nth 0 action))
1038 (what (nth 1 action))
1039 (marks (nth 2 action)))
1040 (assert (or (eq what 'add) (eq what 'del)) nil
1041 "Unknown request-set-mark action: %s" what)
1042 (dolist (mark marks)
1043 (setq nnml-marks (gnus-update-alist-soft
1044 mark
1045 (funcall (if (eq what 'add) 'gnus-range-add
1046 'gnus-remove-from-range)
1047 (cdr (assoc mark nnml-marks)) range)
1048 nnml-marks)))))
1049 (nnml-save-marks group server)) 1037 (nnml-save-marks group server))
1050 nil) 1038 nil)
1051 1039
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 46cc0d281a6..f37a1c8c48f 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1118,19 +1118,7 @@ command whose response triggered the error."
1118 nntp-marks-file-name) 1118 nntp-marks-file-name)
1119 (nntp-possibly-create-directory group server) 1119 (nntp-possibly-create-directory group server)
1120 (nntp-open-marks group server) 1120 (nntp-open-marks group server)
1121 (dolist (action actions) 1121 (setq nntp-marks (nnheader-update-marks-actions nntp-marks actions))
1122 (let ((range (nth 0 action))
1123 (what (nth 1 action))
1124 (marks (nth 2 action)))
1125 (assert (or (eq what 'add) (eq what 'del)) nil
1126 "Unknown request-set-mark action: %s" what)
1127 (dolist (mark marks)
1128 (setq nntp-marks (gnus-update-alist-soft
1129 mark
1130 (funcall (if (eq what 'add) 'gnus-range-add
1131 'gnus-remove-from-range)
1132 (cdr (assoc mark nntp-marks)) range)
1133 nntp-marks)))))
1134 (nntp-save-marks group server)) 1122 (nntp-save-marks group server))
1135 nil) 1123 nil)
1136 1124