+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.
(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
(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))))
;; 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)))
"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))
nnimap-mark-to-flag-1
nnimap-mark-to-flag
nnimap-mark-permanent-p
- nnimap-remassoc
- nnimap-update-alist-soft
)))
(provide 'nnimap)
(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)
(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))