Commit 5f285722 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen Committed by Katsumi Yamaoka
Browse files

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.
parent 17dd2281
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.
* 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 <yamaoka@jpl.org>
 
......
......@@ -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.
......
......@@ -1186,19 +1186,7 @@ This command does not work if you use short group names."
(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)
......
......@@ -1078,6 +1078,26 @@ See `find-file-noselect' for the arguments."
(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))
......
......@@ -941,9 +941,10 @@ textual parts.")
(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.
......
......@@ -1590,7 +1590,7 @@ by nnmaildir-request-article.")
(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)
......
......@@ -1033,19 +1033,7 @@ Use the nov database for the current group if available."
(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)
......
......@@ -1118,19 +1118,7 @@ command whose response triggered the error."
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment