diff options
| author | Richard M. Stallman | 1998-06-26 20:10:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-26 20:10:57 +0000 |
| commit | 6582d61ec5292f45f391af9a2c55054ef2bfab7f (patch) | |
| tree | be7ee51c429e4c7c212f6c0dcdfc8607e81cd400 | |
| parent | 5f29fdb2c9fcf4b19847446dcc307af6fe0f072f (diff) | |
| download | emacs-6582d61ec5292f45f391af9a2c55054ef2bfab7f.tar.gz emacs-6582d61ec5292f45f391af9a2c55054ef2bfab7f.zip | |
*** empty log message ***
| -rw-r--r-- | lispref/loading.texi | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lispref/loading.texi b/lispref/loading.texi index fb2e3014b85..093644354e7 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi | |||
| @@ -687,6 +687,21 @@ library with @code{defun}, @code{defalias}, @code{defsubst}, | |||
| 687 | It then restores any autoloads formerly associated with those symbols. | 687 | It then restores any autoloads formerly associated with those symbols. |
| 688 | (Loading saves these in the @code{autoload} property of the symbol.) | 688 | (Loading saves these in the @code{autoload} property of the symbol.) |
| 689 | 689 | ||
| 690 | Before restoring the previous definitions, @code{unload-feature} runs | ||
| 691 | @code{remove-hook} to remove functions in the library from certain | ||
| 692 | hooks. These hooks include variables whose names end in @samp{hook} or | ||
| 693 | @samp{-hooks}, plus those listed in @code{loadhist-special-hooks}. This | ||
| 694 | is to prevent Emacs from ceasing to function because important hooks | ||
| 695 | refer to functions that are no longer defined. | ||
| 696 | |||
| 697 | @vindex @var{feature}-unload-hook | ||
| 698 | If these measures are not sufficient to prevent malfunction, a library | ||
| 699 | can define an explicit unload hook. If @code{@var{feature}-unload-hook} | ||
| 700 | is defined, it is run as a normal hook before restoring the previous | ||
| 701 | definitions, @emph{instead of} the usual hook-removing actions. The | ||
| 702 | unload hook ought to undo all the global state changes made by the | ||
| 703 | library that might cease to work once the library is unloaded. | ||
| 704 | |||
| 690 | Ordinarily, @code{unload-feature} refuses to unload a library on which | 705 | Ordinarily, @code{unload-feature} refuses to unload a library on which |
| 691 | other loaded libraries depend. (A library @var{a} depends on library | 706 | other loaded libraries depend. (A library @var{a} depends on library |
| 692 | @var{b} if @var{a} contains a @code{require} for @var{b}.) If the | 707 | @var{b} if @var{a} contains a @code{require} for @var{b}.) If the |
| @@ -726,6 +741,14 @@ The value of @code{load-history} may have one element whose @sc{car} is | |||
| 726 | by adding the symbols defined to the element for the file being visited, | 741 | by adding the symbols defined to the element for the file being visited, |
| 727 | rather than replacing that element. @xref{Eval}. | 742 | rather than replacing that element. @xref{Eval}. |
| 728 | 743 | ||
| 744 | Preloaded libraries don't contribute to @code{load-history}. | ||
| 745 | |||
| 746 | @tindex loadhist-special-hooks | ||
| 747 | @defvar loadhist-special-hooks | ||
| 748 | This variable holds a list of hooks to be scanned before unloading a | ||
| 749 | library, to remove functions defined in the library. | ||
| 750 | @end defvar | ||
| 751 | |||
| 729 | @node Hooks for Loading | 752 | @node Hooks for Loading |
| 730 | @section Hooks for Loading | 753 | @section Hooks for Loading |
| 731 | @cindex loading hooks | 754 | @cindex loading hooks |