2001-09-28 07:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
[gnus] / lisp / nnimap.el
index edea544..a93bfa9 100644 (file)
@@ -912,7 +912,7 @@ function is generally only called when Gnus is shutting down."
                                         (imap-mailbox-get 'flags))))
                    (gnus-info-set-marks
                     info
-                    (nnimap-update-alist-soft
+                    (gnus-update-alist-soft
                      (cdr pred)
                      (gnus-compress-sequence
                       (imap-search (nnimap-mark-to-predicate (cdr pred))))
@@ -925,7 +925,7 @@ function is generally only called when Gnus is shutting down."
          ;; so we remove that mark for gnus since we support dormant
          (gnus-info-set-marks
           info
-          (nnimap-update-alist-soft
+          (gnus-update-alist-soft
            'tick
            (gnus-remove-from-range
             (cdr-safe (assoc 'tick (gnus-info-marks info)))
@@ -953,8 +953,16 @@ function is generally only called when Gnus is shutting down."
                (what  (nth 1 action))
                (cmdmarks (nth 2 action))
                marks)
+           ;; bookmark can't be stored (not list/range
+           (setq cmdmarks (delq 'bookmark cmdmarks))
+           ;; killed can't be stored (not list/range
+           (setq cmdmarks (delq 'killed cmdmarks))
+           ;; unsent are for nndraft groups only
+           (setq cmdmarks (delq 'unsent cmdmarks))
            ;; cache flags are pointless on the server
            (setq cmdmarks (delq 'cache cmdmarks))
+           ;; seen flags are local to each gnus
+           (setq cmdmarks (delq 'seen cmdmarks))
            ;; recent marks can't be set
            (setq cmdmarks (delq 'recent cmdmarks))
            (when nnimap-importantize-dormant
@@ -1139,9 +1147,9 @@ function is generally only called when Gnus is shutting down."
 
 (defun nnimap-expiry-target (arts group server)
   (unless (eq nnmail-expiry-target 'delete)
-    (with-current-buffer nntp-server-buffer
+    (with-temp-buffer
       (dolist (art (gnus-uncompress-sequence arts))
-       (nnimap-request-article art group server)
+       (nnimap-request-article art group server  (current-buffer))
        ;; hints for optimization in `nnimap-request-accept-article'
        (let ((nnimap-current-move-article art)
              (nnimap-current-move-group group)
@@ -1352,23 +1360,6 @@ be used in a STORE FLAGS command."
   "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
   (imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
 
-(defun nnimap-remassoc (key alist)
-  "Delete by side effect any elements of LIST whose car is `equal' to KEY.
-The modified LIST is returned.  If the first member
-of LIST has a car that is `equal' to KEY, there is no way to remove it
-by side effect; therefore, write `(setq foo (remassoc key foo))' to be
-sure of changing the value of `foo'."
-  (when alist
-    (if (equal key (caar alist))
-       (cdr alist)
-      (setcdr alist (nnimap-remassoc key (cdr alist)))
-      alist)))
-
-(defun nnimap-update-alist-soft (key value alist)
-  (if value
-      (cons (cons key value) (nnimap-remassoc key alist))
-    (nnimap-remassoc key alist)))
-
 (when nnimap-debug
   (require 'trace)
   (buffer-disable-undo (get-buffer-create nnimap-debug))
@@ -1429,8 +1420,6 @@ sure of changing the value of `foo'."
            nnimap-mark-to-flag-1
            nnimap-mark-to-flag
            nnimap-mark-permanent-p
-           nnimap-remassoc
-           nnimap-update-alist-soft
            )))
 
 (provide 'nnimap)