Function: imap-remassoc
imap-remassoc is a byte-compiled function defined in imap.el.gz.
Signature
(imap-remassoc KEY ALIST)
Documentation
Delete by side effect any elements of ALIST whose car is equal to KEY.
The modified ALIST is returned. If the first member
of ALIST 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.
Source Code
;; Defined in /usr/src/emacs/lisp/net/imap.el.gz
;;; Utility functions
(defun imap-remassoc (key alist)
"Delete by side effect any elements of ALIST whose car is `equal' to KEY.
The modified ALIST is returned. If the first member
of ALIST 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 (imap-remassoc key (cdr alist)))
alist)))