changeset 9535:a2908d5da32a

(add-to-list): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Fri, 14 Oct 1994 23:50:35 +0000
parents 323dc8f5028a
children ecaa7babab17
files lisp/subr.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Fri Oct 14 20:19:27 1994 +0000
+++ b/lisp/subr.el	Fri Oct 14 23:50:35 1994 +0000
@@ -712,7 +712,12 @@
 	(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)))))