diff options
author | Richard M. Stallman <rms@gnu.org> | 2003-04-24 23:14:23 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2003-04-24 23:14:23 +0000 |
commit | d87a4a45db308ca77462c0d1e6561ac0c8086dd8 (patch) | |
tree | dca8dafbca4cfacb46471fe7ae0b039e91f0baba /lisp | |
parent | f8cecb20b34ca9f262687efa67e7d4d709bd0b46 (diff) | |
download | emacs-d87a4a45db308ca77462c0d1e6561ac0c8086dd8.tar.gz emacs-d87a4a45db308ca77462c0d1e6561ac0c8086dd8.tar.bz2 emacs-d87a4a45db308ca77462c0d1e6561ac0c8086dd8.zip |
(assq-delete-all): Ignore non-cons elememts.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/subr.el | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db9f7ba5aa5..5611fbeec4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2003-04-24 Lars Hansen <larsh@math.ku.dk> + + * subr.el (assq-delete-all): Ignore non-cons elememts. + 2003-04-24 John Paul Wallington <jpw@gnu.org> * help-mode.el (help-make-xrefs): Remove extra paren. diff --git a/lisp/subr.el b/lisp/subr.el index f5a629de924..8390d9c56dd 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2048,10 +2048,11 @@ If function is a command (see `commandp'), value is a list of the form (defun assq-delete-all (key alist) "Delete from ALIST all elements whose car is KEY. -Return the modified alist." +Return the modified alist. +Elements of ALIST that are not conses are ignored." (let ((tail alist)) (while tail - (if (eq (car (car tail)) key) + (if (and (consp (car tail)) (eq (car (car tail)) key)) (setq alist (delq (car tail) alist))) (setq tail (cdr tail))) alist)) |