comparison doc/lispref/loading.texi @ 85688:b210bba3f477

Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 131-137) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 261-262) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-908
author Miles Bader <miles@gnu.org>
date Sat, 27 Oct 2007 09:07:17 +0000
parents 0ba80d073e27
children 72447710b4f2
comparison
equal deleted inserted replaced
85687:666ace46440f 85688:b210bba3f477
860 library with @code{defun}, @code{defalias}, @code{defsubst}, 860 library with @code{defun}, @code{defalias}, @code{defsubst},
861 @code{defmacro}, @code{defconst}, @code{defvar}, and @code{defcustom}. 861 @code{defmacro}, @code{defconst}, @code{defvar}, and @code{defcustom}.
862 It then restores any autoloads formerly associated with those symbols. 862 It 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
866 Before restoring the previous definitions, @code{unload-feature} runs 865 Before 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
868 hooks. These hooks include variables whose names end in @samp{hook} 867 hooks. These hooks include variables whose names end in @samp{hook}
869 or @samp{-hooks}, plus those listed in 868 or @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
871 ceasing to function because important hooks refer to functions that 870 @code{auto-mode-alist}. This is to prevent Emacs from ceasing to
872 are no longer defined. 871 function because important hooks refer to functions that are no longer
873 872 defined.
874 @vindex @var{feature}-unload-hook 873
874 Standard unloading activities also undoes ELP profiling of functions
875 in that library, unprovides any features provided by the library, and
876 cancels timers held in variables defined by the library.
877
878 @vindex @var{feature}-unload-function
875 If these measures are not sufficient to prevent malfunction, a library 879 If these measures are not sufficient to prevent malfunction, a library
876 can define an explicit unload hook. If @code{@var{feature}-unload-hook} 880 can define an explicit unloader named @code{@var{feature}-unload-function}.
877 is defined, it is run as a normal hook before restoring the previous 881 If that symbol is defined as a function, @code{unload-feature} calls
878 definitions, @emph{instead of} the usual hook-removing actions. The 882 it with no arguments before doing anything else. It can do whatever
879 unload hook ought to undo all the global state changes made by the 883 is appropriate to unload the library. If it returns @code{nil},
880 library 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 885 Otherwise it considers the job to be done.
882 this, so it should be used with caution.
883 886
884 Ordinarily, @code{unload-feature} refuses to unload a library on which 887 Ordinarily, @code{unload-feature} refuses to unload a library on which
885 other loaded libraries depend. (A library @var{a} depends on library 888 other loaded libraries depend. (A library @var{a} depends on library
886 @var{b} if @var{a} contains a @code{require} for @var{b}.) If the 889 @var{b} if @var{a} contains a @code{require} for @var{b}.) If the
887 optional argument @var{force} is non-@code{nil}, dependencies are 890 optional argument @var{force} is non-@code{nil}, dependencies are