From: Karl Heuer Date: Tue, 7 Apr 1998 18:22:28 +0000 (+0000) Subject: (add-to-list): Always return updated value of LIST-VAR. X-Git-Tag: emacs-20.3~1665 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=15171a06d35ecbe33a98aa48751e47a717684bcd;p=emacs.git (add-to-list): Always return updated value of LIST-VAR. --- diff --git a/lisp/subr.el b/lisp/subr.el index b3ad3560eeb..653ab63e015 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -664,8 +664,9 @@ until a certain package is loaded, you should put the call to `add-to-list' into a hook function that will be run only after loading the package. `eval-after-load' provides one way to do this. In some cases other hooks, such as major mode hooks, can do the job." - (or (member element (symbol-value list-var)) - (set list-var (cons element (symbol-value list-var))))) + (if (member element (symbol-value list-var)) + (symbol-value list-var) + (set list-var (cons element (symbol-value list-var))))) ;;;; Specifying things to do after certain files are loaded.