2001-08-18 Simon Josefsson <jas@extundo.com>
authorSimon Josefsson <jas@extundo.com>
Sat, 18 Aug 2001 19:11:50 +0000 (19:11 +0000)
committerSimon Josefsson <jas@extundo.com>
Sat, 18 Aug 2001 19:11:50 +0000 (19:11 +0000)
* gnus-util.el (gnus-remassoc, gnus-update-alist-soft): Moved from
nnimap.

* nnimap.el (nnimap-remassoc, nnimap-update-alist-soft): Moved to
gnus-util.
(nnimap-request-update-info-internal): Use new functions.

* nnml.el (nnml-request-set-mark, nnml-request-update-info): Use
new functions.

lisp/ChangeLog
lisp/gnus-util.el
lisp/nnimap.el
lisp/nnml.el

index 480a9a8..2694590 100644 (file)
@@ -1,3 +1,15 @@
+2001-08-18  Simon Josefsson  <jas@extundo.com>
+
+       * gnus-util.el (gnus-remassoc, gnus-update-alist-soft): Moved from
+       nnimap.
+
+       * nnimap.el (nnimap-remassoc, nnimap-update-alist-soft): Moved to
+       gnus-util.
+       (nnimap-request-update-info-internal): Use new functions.
+
+       * nnml.el (nnml-request-set-mark, nnml-request-update-info): Use
+       new functions.
+
 2001-08-18  Simon Josefsson  <jas@extundo.com>
 
        Make nnml groups self-contained as far as marks are concerned.
index 22be8a6..cadc7af 100644 (file)
@@ -1041,6 +1041,23 @@ Return the modified alist."
        (byte-compile form))
     form))
 
+(defun gnus-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 (gnus-remassoc key (cdr alist)))
+      alist)))
+
+(defun gnus-update-alist-soft (key value alist)
+  (if value
+      (cons (cons key value) (gnus-remassoc key alist))
+    (gnus-remassoc key alist)))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
index edea544..027517e 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)))
@@ -1352,23 +1352,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 +1412,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)
index 7617dec..0432ae7 100644 (file)
@@ -873,7 +873,7 @@ check twice.")
        (assert (or (eq what 'add) (eq what 'del)) t
                "Unknown request-set-mark action: %s" what)
        (dolist (mark marks)
-         (setq nnml-marks (nnimap-update-alist-soft
+         (setq nnml-marks (gnus-update-alist-soft
                            mark
                            (funcall (if (eq what 'add) 'gnus-range-add
                                       'gnus-remove-from-range)
@@ -889,7 +889,7 @@ check twice.")
     (mapcar (lambda (pred)
              (gnus-info-set-marks
               info
-              (nnimap-update-alist-soft
+              (gnus-update-alist-soft
                (cdr pred)
                (cdr (assq (cdr pred) nnml-marks))
                (gnus-info-marks info))