Function: adelete

adelete is a byte-compiled function defined in assoc.el.gz.

Signature

(adelete ALIST-SYMBOL KEY)

Documentation

Delete a key-value pair from the alist.

Alist is referenced by ALIST-SYMBOL and the key-value pair to remove is pair matching KEY. Returns the altered alist.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/assoc.el.gz
(defun adelete (alist-symbol key)
  "Delete a key-value pair from the alist.
Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
is pair matching KEY.  Returns the altered alist."
  (asort alist-symbol key)
  (let ((alist (symbol-value alist-symbol)))
    (cond ((null alist) nil)
	  ((anot-head-p alist key) alist)
	  (t (set alist-symbol (cdr alist))))))