From: Richard M. Stallman Date: Thu, 24 Apr 2003 23:14:23 +0000 (+0000) Subject: (assq-delete-all): Ignore non-cons elememts. X-Git-Tag: ttn-vms-21-2-B4~10426 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d87a4a45db308ca77462c0d1e6561ac0c8086dd8;p=emacs.git (assq-delete-all): Ignore non-cons elememts. --- 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 + + * subr.el (assq-delete-all): Ignore non-cons elememts. + 2003-04-24 John Paul Wallington * 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))