changeset 50694:fc93ef4196d1

(assq-delete-all): Ignore non-cons elememts.
author Richard M. Stallman <rms@gnu.org>
date Thu, 24 Apr 2003 23:14:12 +0000
parents 17c60796aa6a
children 948ab0c613c3
files lisp/subr.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Thu Apr 24 16:16:56 2003 +0000
+++ b/lisp/subr.el	Thu Apr 24 23:14:12 2003 +0000
@@ -2048,10 +2048,11 @@
 
 (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))