aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-24 08:17:47 +0000
committerRichard M. Stallman2007-10-24 08:17:47 +0000
commit0ade8edb2d4ee782cc5f1628284d273aed6871b7 (patch)
tree25e2d07fd68b1ddcfed5aeaa7fc2c48287793754
parent39dc0d57c2940a3a0ac21590827835a1b196713e (diff)
downloademacs-0ade8edb2d4ee782cc5f1628284d273aed6871b7.tar.gz
emacs-0ade8edb2d4ee782cc5f1628284d273aed6871b7.zip
(Unloading): Document FEATURE-unload-function instead of FEATURE-unload-hook.
-rw-r--r--lispref/loading.texi27
1 files changed, 15 insertions, 12 deletions
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 058ed9c8984..34f1cff8900 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -862,24 +862,27 @@ library with @code{defun}, @code{defalias}, @code{defsubst},
862It then restores any autoloads formerly associated with those symbols. 862It then restores any autoloads formerly associated with those symbols.
863(Loading saves these in the @code{autoload} property of the symbol.) 863(Loading saves these in the @code{autoload} property of the symbol.)
864 864
865@vindex unload-feature-special-hooks
866Before restoring the previous definitions, @code{unload-feature} runs 865Before restoring the previous definitions, @code{unload-feature} runs
867@code{remove-hook} to remove functions in the library from certain 866@code{remove-hook} to remove functions in the library from certain
868hooks. These hooks include variables whose names end in @samp{hook} 867hooks. These hooks include variables whose names end in @samp{hook}
869or @samp{-hooks}, plus those listed in 868or @samp{-hooks}, plus those listed in
870@code{unload-feature-special-hooks}. This is to prevent Emacs from 869@code{unload-feature-special-hooks}, as well as
871ceasing to function because important hooks refer to functions that 870@code{auto-mode-alist}. This is to prevent Emacs from ceasing to
872are no longer defined. 871function because important hooks refer to functions that are no longer
872defined.
873 873
874@vindex @var{feature}-unload-hook 874Standard unloading activities also undoes ELP profiling of functions
875in that library, unprovides any features provided by the library, and
876cancels timers held in variables defined by the library.
877
878@vindex @var{feature}-unload-function
875If these measures are not sufficient to prevent malfunction, a library 879If these measures are not sufficient to prevent malfunction, a library
876can define an explicit unload hook. If @code{@var{feature}-unload-hook} 880can define an explicit unloader named @code{@var{feature}-unload-function}.
877is defined, it is run as a normal hook before restoring the previous 881If that symbol is defined as a function, @code{unload-feature} calls
878definitions, @emph{instead of} the usual hook-removing actions. The 882it with no arguments before doing anything else. It can do whatever
879unload hook ought to undo all the global state changes made by the 883is appropriate to unload the library. If it returns @code{nil},
880library that might cease to work once the library is unloaded. 884@code{unload-feature} proceeds to take the normal unload actions.
881@code{unload-feature} can cause problems with libraries that fail to do 885Otherwise it considers the job to be done.
882this, so it should be used with caution.
883 886
884Ordinarily, @code{unload-feature} refuses to unload a library on which 887Ordinarily, @code{unload-feature} refuses to unload a library on which
885other loaded libraries depend. (A library @var{a} depends on library 888other loaded libraries depend. (A library @var{a} depends on library