mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-27 07:37:33 +00:00
(add-to-list): Don't continue checking if a match has
been found.
This commit is contained in:
parent
5fb9c53c67
commit
2d1dd54d7d
@ -1,3 +1,8 @@
|
||||
2006-10-30 David Kastrup <dak@gnu.org>
|
||||
|
||||
* subr.el (add-to-list): Don't continue checking if a match has
|
||||
been found.
|
||||
|
||||
2006-10-30 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* tutorial.el: Move defvars to avoid bytecomp warnings.
|
||||
|
10
lisp/subr.el
10
lisp/subr.el
@ -1108,11 +1108,11 @@ other hooks, such as major mode hooks, can do the job."
|
||||
((eq compare-fn 'eql)
|
||||
(memql element (symbol-value list-var)))
|
||||
(t
|
||||
(let (present)
|
||||
(dolist (elt (symbol-value list-var))
|
||||
(if (funcall compare-fn element elt)
|
||||
(setq present t)))
|
||||
present)))
|
||||
(let ((lst (symbol-value list-var)))
|
||||
(while (and lst
|
||||
(not (funcall compare-fn element (car lst))))
|
||||
(setq lst (cdr lst)))
|
||||
lst)))
|
||||
(symbol-value list-var)
|
||||
(set list-var
|
||||
(if append
|
||||
|
Loading…
Reference in New Issue
Block a user