Mercurial > emacs
diff lispref/loading.texi @ 90070:95879cc1ed20
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-81
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-748
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-749
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-751
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-753
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-754
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-755
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-757
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-78
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-79
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-80
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-81
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 02 Jan 2005 09:13:19 +0000 |
parents | 59dcbfe97385 a108297939dd |
children | 7e3f621f1dd4 |
line wrap: on
line diff
--- a/lispref/loading.texi Sat Dec 25 02:31:08 2004 +0000 +++ b/lispref/loading.texi Sun Jan 02 09:13:19 2005 +0000 @@ -36,15 +36,16 @@ containing Lisp code. @menu -* How Programs Do Loading:: The @code{load} function and others. -* Library Search:: Finding a library to load. -* Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. -* Autoload:: Setting up a function to autoload. -* Repeated Loading:: Precautions about loading a file twice. -* Named Features:: Loading a library if it isn't already loaded. -* Unloading:: How to ``unload'' a library that was loaded. -* Hooks for Loading:: Providing code to be run when - particular libraries are loaded. +* How Programs Do Loading:: The @code{load} function and others. +* Library Search:: Finding a library to load. +* Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. +* Autoload:: Setting up a function to autoload. +* Repeated Loading:: Precautions about loading a file twice. +* Named Features:: Loading a library if it isn't already loaded. +* Where Defined:: Finding which file defined a certain symbol. +* Unloading:: How to ``unload'' a library that was loaded. +* Hooks for Loading:: Providing code to be run when + particular libraries are loaded. @end menu @node How Programs Do Loading @@ -714,6 +715,60 @@ @code{features} list is not significant. @end defvar +@node Where Defined +@section Which File Defined a Certain Symbol + +@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 the file name as it was specified to @code{load}: +either an absolute file name, or a library name +(with no directory name and no @samp{.el} or @samp{.elc} at the end). +It can also be @code{nil}, if the definition is not associated with any file. +@end defun + + The basis for @code{symbol-file} is the data in the variable +@code{load-history}. + +@defvar load-history +This variable's value is an alist connecting library names with the +names of functions and variables they define, the features they provide, +and the features they require. + +Each element is a list and describes one library. The @sc{car} of the +list is the name of the library, as a string. The rest of the list +elements have these forms: + +@table @code +@item @var{var} +The symbol @var{var} was defined as a variable. +@item (defun . @var{fun}) +The @var{fun} was defined by this library. +@item (t . @var{fun}) +The function @var{fun} was previously an autoload before this library +redefined it as a function. The following element is always the +symbol @var{fun}, which signifies that the library defined @var{fun} +as a function. +@item (autoload . @var{fun}) +The function @var{fun} was defined as an autoload. +@item (require . @var{feature}) +The feature @var{feature} was required. +@item (provide . @var{feature}) +The feature @var{feature} was provided. +@end table + +The value of @code{load-history} may have one element whose @sc{car} is +@code{nil}. This element describes definitions made with +@code{eval-buffer} on a buffer that is not visiting a file. +@end defvar + + The command @code{eval-region} updates @code{load-history}, but does so +by adding the symbols defined to the element for the file being visited, +rather than replacing that element. @xref{Eval}. + @node Unloading @section Unloading @cindex unloading @@ -760,42 +815,6 @@ The @code{unload-feature} function is written in Lisp; its actions are based on the variable @code{load-history}. -@defvar load-history -This variable's value is an alist connecting library names with the -names of functions and variables they define, the features they provide, -and the features they require. - -Each element is a list and describes one library. The @sc{car} of the -list is the name of the library, as a string. The rest of the list -elements have these forms: - -@table @code -@item @var{fun} -The function @var{fun} was defined by this library. -@item (t . @var{fun}) -The function @var{fun} was previously an autoload before this library -redefined it as a function. The following element is always the -symbol @var{fun}, which signifies that the library defined @var{fun} -as a function. -@item (autoload . @var{fun}) -The function @var{fun} was defined as an autoload. -@item (defvar . @var{var}) -The symbol @var{var} was defined as a variable. -@item (require . @var{feature}) -The feature @var{feature} was required. -@item (provide . @var{feature}) -The feature @var{feature} was provided. -@end table - -The value of @code{load-history} may have one element whose @sc{car} is -@code{nil}. This element describes definitions made with -@code{eval-buffer} on a buffer that is not visiting a file. -@end defvar - - The command @code{eval-region} updates @code{load-history}, but does so -by adding the symbols defined to the element for the file being visited, -rather than replacing that element. @xref{Eval}. - @defvar unload-feature-special-hooks This variable holds a list of hooks to be scanned before unloading a library, to remove functions defined in the library.