Function: rassq-delete-all
rassq-delete-all is a byte-compiled function defined in subr.el.gz.
Signature
(rassq-delete-all VALUE ALIST)
Documentation
Delete from ALIST all elements whose cdr is eq to VALUE.
Return the modified alist. Elements of ALIST that are not conses are ignored.
Other relevant functions are documented in the alist group.
Probably introduced at or before Emacs version 22.1.
Shortdoc
;; alist
(rassq-delete-all 'bar '((foo . bar) (zot . baz)))
=> ((zot . baz))
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun rassq-delete-all (value alist)
"Delete from ALIST all elements whose cdr is `eq' to VALUE.
Return the modified alist.
Elements of ALIST that are not conses are ignored."
(while (and (consp (car alist))
(eq (cdr (car alist)) value))
(setq alist (cdr alist)))
(let ((tail alist) tail-cdr)
(while (setq tail-cdr (cdr tail))
(if (and (consp (car tail-cdr))
(eq (cdr (car tail-cdr)) value))
(setcdr tail (cdr tail-cdr))
(setq tail tail-cdr))))
alist)