]> git.eshelyaron.com Git - emacs.git/commitdiff
(add-to-list): Doc fix.
authorRichard M. Stallman <rms@gnu.org>
Fri, 14 Oct 1994 23:50:35 +0000 (23:50 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 14 Oct 1994 23:50:35 +0000 (23:50 +0000)
lisp/subr.el

index 7c0ae0cb9144048f9b68ad65c164f0038dfcf211..b623658e8df01421bab6ca60086473e6ea118c8c 100644 (file)
@@ -712,7 +712,12 @@ To make a hook variable buffer-local, always use
        (set-default hook hook-value)))))
 
 (defun add-to-list (list-var element)
-  "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet."
+  "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
+If you want to use `add-to-list' on a variable that is not defined
+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)))))
 \f