| 864 | | @code{unload-feature-special-hooks}. This is to prevent Emacs from |
|---|
| 865 | | ceasing to function because important hooks refer to functions that |
|---|
| 866 | | are no longer defined. |
|---|
| 867 | | |
|---|
| 868 | | @vindex @var{feature}-unload-hook |
|---|
| | 863 | @code{unload-feature-special-hooks}, as well as |
|---|
| | 864 | @code{auto-mode-alist}. This is to prevent Emacs from ceasing to |
|---|
| | 865 | function because important hooks refer to functions that are no longer |
|---|
| | 866 | defined. |
|---|
| | 867 | |
|---|
| | 868 | Standard unloading activities also undoes ELP profiling of functions |
|---|
| | 869 | in that library, unprovides any features provided by the library, and |
|---|
| | 870 | cancels timers held in variables defined by the library. |
|---|
| | 871 | |
|---|
| | 872 | @vindex @var{feature}-unload-function |
|---|
| 870 | | can define an explicit unload hook. If @code{@var{feature}-unload-hook} |
|---|
| 871 | | is defined, it is run as a normal hook before restoring the previous |
|---|
| 872 | | definitions, @emph{instead of} the usual hook-removing actions. The |
|---|
| 873 | | unload hook ought to undo all the global state changes made by the |
|---|
| 874 | | library that might cease to work once the library is unloaded. |
|---|
| 875 | | @code{unload-feature} can cause problems with libraries that fail to do |
|---|
| 876 | | this, so it should be used with caution. |
|---|
| | 874 | can define an explicit unloader named @code{@var{feature}-unload-function}. |
|---|
| | 875 | If that symbol is defined as a function, @code{unload-feature} calls |
|---|
| | 876 | it with no arguments before doing anything else. It can do whatever |
|---|
| | 877 | is appropriate to unload the library. If it returns @code{nil}, |
|---|
| | 878 | @code{unload-feature} proceeds to take the normal unload actions. |
|---|
| | 879 | Otherwise it considers the job to be done. |
|---|