]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/loading.texi
(Building Lists): Remove obsolete Emacs 20 usage of `append'.
[gnu-emacs] / doc / lispref / loading.texi
index cbea262cc45ecdd91f8ac2659018047faef07a6b..3938ee67bcf3e28da98d8149902cca6b071ae7f6 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/loading
 @node Loading, Byte Compilation, Customization, Top
@@ -501,6 +501,9 @@ consists of @samp{;;;###autoload}, on a line by itself,
 just before the real definition of the function in its
 autoloadable source file.  The command @kbd{M-x update-file-autoloads}
 writes a corresponding @code{autoload} call into @file{loaddefs.el}.
+(The string that serves as the autoload cookie and the name of the
+file generated by @code{update-file-autoloads} can be changed from the
+above defaults, see below.)
 Building Emacs loads @file{loaddefs.el} and thus calls @code{autoload}.
 @kbd{M-x update-directory-autoloads} is even more powerful; it updates
 autoloads for all files in the current directory.
@@ -567,6 +570,26 @@ ordinary magic autoload comment would copy the whole definition into
   ...)
 @end smallexample
 
+  You can use a non-default string as the autoload cookie and have the
+corresponding autoload calls written into a file whose name is
+different from the default @file{loaddefs.el}.  Emacs provides two
+variables to control this:
+
+@defvar generate-autoload-cookie
+The value of this variable should be a string whose syntax is a Lisp
+comment.  @kbd{M-x update-file-autoloads} copies the Lisp form that
+follows the cookie into the autoload file it generates.  The default
+value of this variable is @code{";;;###autoload"}.
+@end defvar
+
+@defvar generated-autoload-file
+The value of this variable names an Emacs Lisp file where the autoload
+calls should go.  The default value is @file{loaddefs.el}, but you can
+override that, e.g., in the ``Local Variables'' section of a
+@file{.el} file (@pxref{File Local Variables}).  The autoload file is
+assumed to contain a trailer starting with a formfeed character.
+@end defvar
+
 @node Repeated Loading
 @section Repeated Loading
 @cindex repeated loading
@@ -692,7 +715,7 @@ done.
   When @code{require} is used at top level in a file, it takes effect
 when you byte-compile that file (@pxref{Byte Compilation}) as well as
 when you load it.  This is in case the required package contains macros
-that the byte compiler must know about.  It also avoids byte-compiler
+that the byte compiler must know about.  It also avoids byte compiler
 warnings for functions and variables defined in the file loaded with
 @code{require}.
 
@@ -798,12 +821,15 @@ with a call to @code{provide}.  The order of the elements in the
 
 @defun symbol-file symbol &optional type
 This function returns the name of the file that defined @var{symbol}.
-If @var{type} is @code{nil}, then any kind of definition is
-acceptable.  If @var{type} is @code{defun} or @code{defvar}, that
-specifies function definition only or variable definition only.
-
-The value is normally an absolute file name.  It can also be
-@code{nil}, if the definition is not associated with any file.
+If @var{type} is @code{nil}, then any kind of definition is acceptable.
+If @var{type} is @code{defun}, @code{defvar}, or @code{defface}, that
+specifies function definition, variable definition, or face definition
+only.
+
+The value is normally an absolute file name.  It can also be @code{nil},
+if the definition is not associated with any file.  If @var{symbol}
+specifies an autoloaded function, the value can be a relative file name
+without extension.
 @end defun
 
   The basis for @code{symbol-file} is the data in the variable
@@ -830,6 +856,8 @@ redefined it as a function.  The following element is always
 function.
 @item (autoload . @var{fun})
 The function @var{fun} was defined as an autoload.
+@item (defface . @var{face})
+The face @var{face} was defined.
 @item (require . @var{feature})
 The feature @var{feature} was required.
 @item (provide . @var{feature})