2001-09-22 Simon Josefsson <jas@extundo.com>
authorSimon Josefsson <jas@extundo.com>
Mon, 24 Sep 2001 17:35:26 +0000 (17:35 +0000)
committerSimon Josefsson <jas@extundo.com>
Mon, 24 Sep 2001 17:35:26 +0000 (17:35 +0000)
* 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.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/gnus.el
lisp/nnfolder.el
lisp/nnml.el

index 3a9c155..3b9574f 100644 (file)
@@ -1,3 +1,22 @@
+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.
index 6861d70..4ab0498 100644 (file)
@@ -696,7 +696,7 @@ This variable is local to the summary buffers."
 (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)
 
@@ -4811,6 +4811,10 @@ If SELECT-ARTICLES, only select those articles from GROUP."
   (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))
@@ -4870,7 +4874,6 @@ If SELECT-ARTICLES, only select those articles from GROUP."
   "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.
@@ -4902,27 +4905,20 @@ If SELECT-ARTICLES, only select those articles from GROUP."
                    (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)))
index 23a4059..ad0b9bc 100644 (file)
@@ -1800,9 +1800,23 @@ covered by that variable."
 
 (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)
index deb8356..6a4c521 100644 (file)
@@ -1224,16 +1224,17 @@ This command does not work if you use short group names."
 (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
@@ -1243,6 +1244,8 @@ This command does not work if you use short group names."
        (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)
index 408c6e5..6010349 100644 (file)
@@ -1000,16 +1000,17 @@ Use the nov database for the current group if available."
               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
@@ -1019,6 +1020,8 @@ Use the nov database for the current group if available."
        (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)