* nnml.el (nnml-open-marks): Remove unpropagatable marks.
* nnfolder.el (nnfolder-open-marks): Ditto.
* gnus-sum.el (gnus-article-unpropagatable-p): New function.
(gnus-update-marks): Use it.
(gnus-update-marks): Use `gnus-article-mark-to-type' instead of
hardcoded list.
* gnus.el (gnus-article-special-mark-lists): Add killed.
(gnus-article-unpropagated-mark-lists): New constant.
2001-09-22 Simon Josefsson <jas@extundo.com>
* gnus-sum.el (gnus-summary-mode-hook): Add gnus-pick-mode as
custom option.
+2001-09-22 Simon Josefsson <jas@extundo.com>
+
+ * nnml.el (nnml-open-marks): Remove unpropagatable marks.
+
+ * nnfolder.el (nnfolder-open-marks): Ditto.
+
+ * gnus-sum.el (gnus-article-unpropagatable-p): New function.
+ (gnus-update-marks): Use it.
+ (gnus-update-marks): Use `gnus-article-mark-to-type' instead of
+ hardcoded list.
+
+ * gnus.el (gnus-article-special-mark-lists): Add killed.
+ (gnus-article-unpropagated-mark-lists): New constant.
+
+2001-09-22 Simon Josefsson <jas@extundo.com>
+
+ * gnus-sum.el (gnus-summary-mode-hook): Add gnus-pick-mode as
+ custom option.
+
2001-09-23 Simon Josefsson <jas@extundo.com>
* gnus-draft.el (gnus-draft-setup): Add mark in backend as well.
(defcustom gnus-summary-mode-hook nil
"*A hook for Gnus summary mode.
This hook is run before any variables are set in the summary buffer."
- :options '(turn-on-gnus-mailing-list-mode)
+ :options '(turn-on-gnus-mailing-list-mode gnus-pick-mode)
:group 'gnus-summary-various
:type 'hook)
(or (cadr (assq mark gnus-article-special-mark-lists))
'list))
+(defun gnus-article-unpropagatable-p (mark)
+ "Return whether MARK should be propagated to backend."
+ (memq mark gnus-article-unpropagated-mark-lists))
+
(defun gnus-adjust-marked-articles (info)
"Set all article lists and remove all marks that are no longer valid."
(let* ((marked-lists (gnus-info-marks info))
"Enter the various lists of marked articles into the newsgroup info list."
(let ((types gnus-article-mark-lists)
(info (gnus-get-info gnus-newsgroup-name))
- (uncompressed '(score bookmark killed seen))
type list newmarked symbol delta-marks)
(when info
;; Add all marks lists to the list of marks lists.
(gnus-add-to-range list gnus-newsgroup-unseen)
(gnus-compress-sequence gnus-newsgroup-articles))))
- (unless (memq (cdr type) uncompressed)
+ (when (eq (gnus-article-mark-to-type (cdr type)) 'list)
(setq list (gnus-compress-sequence (set symbol (sort list '<)) t)))
- (when (gnus-check-backend-function
- 'request-set-mark gnus-newsgroup-name)
- ;; propagate flags to server, with the following exceptions:
- ;; uncompressed:s are not proper flags (they are cons cells)
- ;; cache is a internal gnus flag
- ;; download are local to one gnus installation (well)
- ;; unsend are for nndraft groups only
- ;; xxx: generality of this? this suits nnimap anyway
- (unless (memq (cdr type) (append '(cache download unsend)
- uncompressed))
- (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
- (del (gnus-remove-from-range (gnus-copy-sequence old) list))
- (add (gnus-remove-from-range
- (gnus-copy-sequence list) old)))
- (when add
- (push (list add 'add (list (cdr type))) delta-marks))
- (when del
- (push (list del 'del (list (cdr type))) delta-marks)))))
+ (when (and (gnus-check-backend-function
+ 'request-set-mark gnus-newsgroup-name)
+ (not (gnus-article-unpropagatable-p (cdr type))))
+ (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
+ (del (gnus-remove-from-range (gnus-copy-sequence old) list))
+ (add (gnus-remove-from-range
+ (gnus-copy-sequence list) old)))
+ (when add
+ (push (list add 'add (list (cdr type))) delta-marks))
+ (when del
+ (push (list del 'del (list (cdr type))) delta-marks))))
(when list
(push (cons (cdr type) list) newmarked)))
(defconst gnus-article-special-mark-lists
'((seen range)
+ (killed range)
(bookmark tuple)
(score tuple)))
+;; Propagate flags to server, with the following exceptions:
+;; `seen' is private to each gnus installation
+;; `cache' is a internal gnus flag for each gnus installation
+;; `download' is a agent flag private to each gnus installation
+;; `unsend' are for nndraft groups only
+;; `score' is not a proper mark
+(defconst gnus-article-unpropagated-mark-lists
+ '(seen cache download unsend score)
+ "Marks that shouldn't be propagated to backends.
+Typical marks are those that make no sense in a standalone backend,
+such as a mark that says whether an article is stored in the cache
+(which doesn't make sense in a standalone backend).")
+
(defvar gnus-headers-retrieved-by nil)
(defvar gnus-article-reply nil)
(defvar gnus-override-method nil)
(defun nnfolder-open-marks (group server)
(let ((file (nnfolder-group-marks-pathname group)))
(if (file-exists-p file)
- (setq nnfolder-marks (condition-case err
- (with-temp-buffer
- (gnus-sethash file
- (nth 5 (file-attributes file))
- nnfolder-marks-modtime)
- (nnheader-insert-file-contents file)
- (read (current-buffer)))
- (error (or (gnus-yes-or-no-p
- (format "Error reading nnfolder marks file %s (%s). Continuing will use marks from .newsrc.eld. Continue? " file err))
- (error "Cannot read nnfolder marks file %s (%s)" file err)))))
+ (condition-case err
+ (with-temp-buffer
+ (gnus-sethash file (nth 5 (file-attributes file))
+ nnfolder-marks-modtime)
+ (nnheader-insert-file-contents file)
+ (setq nnfolder-marks (read (current-buffer)))
+ (dolist (el gnus-article-unpropagated-mark-lists)
+ (setq nnfolder-marks (gnus-remassoc el nnfolder-marks))))
+ (error (or (gnus-yes-or-no-p
+ (format "Error reading nnfolder marks file %s (%s). Continuing will use marks from .newsrc.eld. Continue? " file err))
+ (error "Cannot read nnfolder marks file %s (%s)" file err))))
;; User didn't have a .marks file. Probably first time
;; user of the .marks stuff. Bootstrap it from .newsrc.eld.
(let ((info (gnus-get-info
(nnheader-message 7 "Bootstrapping marks for %s..." group)
(setq nnfolder-marks (gnus-info-marks info))
(push (cons 'read (gnus-info-read info)) nnfolder-marks)
+ (dolist (el gnus-article-unpropagated-mark-lists)
+ (setq nnfolder-marks (gnus-remassoc el nnfolder-marks)))
(nnfolder-save-marks group server)))))
(provide 'nnfolder)
nnml-marks-file-name
(nnmail-group-pathname group nnml-directory))))
(if (file-exists-p file)
- (setq nnml-marks (condition-case err
- (with-temp-buffer
- (gnus-sethash file
- (nth 5 (file-attributes file))
- nnml-marks-modtime)
- (nnheader-insert-file-contents file)
- (read (current-buffer)))
- (error (or (gnus-yes-or-no-p
- (format "Error reading nnml marks file %s (%s). Continuing will use marks from .newsrc.eld. Continue? " file err))
- (error "Cannot read nnml marks file %s (%s)" file err)))))
+ (condition-case err
+ (with-temp-buffer
+ (gnus-sethash file (nth 5 (file-attributes file))
+ nnml-marks-modtime)
+ (nnheader-insert-file-contents file)
+ (setq nnml-marks (read (current-buffer)))
+ (dolist (el gnus-article-unpropagated-mark-lists)
+ (setq nnml-marks (gnus-remassoc el nnml-marks))))
+ (error (or (gnus-yes-or-no-p
+ (format "Error reading nnml marks file %s (%s). Continuing will use marks from .newsrc.eld. Continue? " file err))
+ (error "Cannot read nnml marks file %s (%s)" file err))))
;; User didn't have a .marks file. Probably first time
;; user of the .marks stuff. Bootstrap it from .newsrc.eld.
(let ((info (gnus-get-info
(nnheader-message 7 "Bootstrapping marks for %s..." group)
(setq nnml-marks (gnus-info-marks info))
(push (cons 'read (gnus-info-read info)) nnml-marks)
+ (dolist (el gnus-article-unpropagated-mark-lists)
+ (setq nnml-marks (gnus-remassoc el nnml-marks)))
(nnml-save-marks group server)))))
(provide 'nnml)