# HG changeset patch # User Richard M. Stallman # Date 782178635 0 # Node ID a2908d5da32a2d98f58d1ac360b45adbee038427 # Parent 323dc8f5028a8f16fbb04149e5bee275060aa177 (add-to-list): Doc fix. diff -r 323dc8f5028a -r a2908d5da32a lisp/subr.el --- 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)))))