From: Glenn Morris Date: Sat, 9 Jul 2011 00:50:01 +0000 (-0400) Subject: * lisp/subr.el (remq): Handle the empty list. (Bug#9024) X-Git-Tag: emacs-pretest-24.0.90~104^2~416 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7f9b7c53affac3e9fb4e0270e6c71c90cc40b1b2;p=emacs.git * lisp/subr.el (remq): Handle the empty list. (Bug#9024) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 729013ba54c..81ce153600c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-07-09 Glenn Morris + + * subr.el (remq): Handle the empty list. (Bug#9024) + 2011-07-08 Andreas Schwab * mail/sendmail.el (send-mail-function): No longer delay custom diff --git a/lisp/subr.el b/lisp/subr.el index 48158466c6b..5c9d6c8d724 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -490,7 +490,7 @@ SEQ must be a list, vector, or string. The comparison is done with `equal'." "Return LIST with all occurrences of ELT removed. The comparison is done with `eq'. Contrary to `delq', this does not use side-effects, and the argument LIST is not modified." - (while (eq elt (car list)) (setq list (cdr list))) + (while (and (eq elt (car list)) (setq list (cdr list)))) (if (memq elt list) (delq elt (copy-sequence list)) list))