diff options
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)) |