+
+@node Mode Hooks, , Choosing Modes, Major Modes
+@section Mode Hook Variables
+
+@cindex Hook variables
+@cindex mode hook
+@findex add-hook
+@findex remove-hook
+@vindex lisp-mode-hook
+@vindex emacs-lisp-mode-hook
+@vindex lisp-interaction-mode-hook
+@vindex scheme-mode-hook
+
+ The last step taken by a major mode, by convention, is to invoke a
+list of user supplied functions that are stored in a ``hook'' variable.
+This allows a user to further customize the major mode, and is
+particularly convenient for setting up buffer local variables
+(@pxref{Locals}).
+
+ The name of the hook variable is created by appending the string
+@code{-hook} to the name of the major mode. For example, the hook
+variable used by @code{text-mode} would be named @code{text-mode-hook}.
+By convention the mode hook function receives no arguments. If a hook
+variable does not exist, or it has the value @code{nil}, the major mode
+simply ignores it.
+
+ The recommended way to add functions to a hook variable is with the
+@code{add-hook} function. For example, to automatically turn on the
+Auto Fill mode when Text mode is invoked the following code can be used in
+the initialization file (@pxref{Init File})
+
+@example
+(add-hook 'text-mode-hook 'turn-on-auto-fill)
+@end example
+
+The @code{add-hook} function will check that the function is not already
+listed in the hook variable before adding it. It will also create a hook
+variable with the value @code{nil} if one does not exist before adding
+the function. @code{add-hook} adds functions to the front of the hook
+variable list. This means that the last hook added is run first by the
+major mode. It is considered very poor style to write hook functions
+that depend on the order that hooks are executed.
+
+Hooks can be removed from hook variables with @code{remove-hook}.
+
+