2010-11-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * 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.
(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)))
- (dolist (mark marks)
- (setq nnfolder-marks
- (gnus-update-alist-soft
- mark
- (cond
- ((eq what 'add)
- (gnus-range-add (cdr (assoc mark nnfolder-marks)) range)
- ((eq what 'del)
- (gnus-remove-from-range
- (cdr (assoc mark nnfolder-marks)) range))
- ((eq what 'set)
- range)))
- nnfolder-marks)))))
+ (setq nnfolder-marks (nnheader-update-marks-actions nnfolder-marks actions))
(nnfolder-save-marks group server))
nil)
(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))
(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) (eq what 'set)) nil
- "Unknown request-set-mark action: %s" what)
- (dolist (mark marks)
- (setq nnml-marks
- (gnus-update-alist-soft
- mark
- (cond
- ((eq what 'add)
- (gnus-range-add (cdr (assoc mark nnml-marks)) range)
- ((eq what 'del)
- (gnus-remove-from-range (cdr (assoc mark nnml-marks)) range))
- ((eq what 'set)
- range)))
- nnml-marks)))))
+ (setq nnml-marks (nnheader-update-marks-actions nnml-marks actions))
(nnml-save-marks group server))
nil)
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)))
- (dolist (mark marks)
- (setq nntp-marks
- (gnus-update-alist-soft
- mark
- (cond
- ((eq what 'add)
- (gnus-range-add (cdr (assoc mark nntp-marks)) range)
- ((eq what 'del)
- (gnus-remove-from-range (cdr (assoc mark nntp-marks)) range))
- ((eq what 'set)
- range)))
- nntp-marks)))))
+ (setq nntp-marks (nnheader-update-marks-actions nntp-marks actions))
(nntp-save-marks group server))
nil)