aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2005-05-14 15:25:38 +0000
committerLuc Teirlinck2005-05-14 15:25:38 +0000
commitc71f84bd99f89004fed48064305b5f79ff13139f (patch)
treef5a024c31679f5b2213ea1fa315233718f469861
parentce58b669c2cc3a44cef1d26bd08edd61941a747b (diff)
downloademacs-c71f84bd99f89004fed48064305b5f79ff13139f.tar.gz
emacs-c71f84bd99f89004fed48064305b5f79ff13139f.zip
(Hooks): Most minor modes run mode hooks too.
`add-hook' can handle void hooks or hooks whose value is a single function.
-rw-r--r--lispref/modes.texi12
1 files changed, 8 insertions, 4 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi
index c3247b4ca57..47d9ded1346 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2836,10 +2836,10 @@ a uniform way.
2836 Every major mode function is supposed to run a normal hook called the 2836 Every major mode function is supposed to run a normal hook called the
2837@dfn{mode hook} as the last step of initialization. This makes it easy 2837@dfn{mode hook} as the last step of initialization. This makes it easy
2838for a user to customize the behavior of the mode, by overriding the 2838for a user to customize the behavior of the mode, by overriding the
2839buffer-local variable assignments already made by the mode. But hooks 2839buffer-local variable assignments already made by the mode. Most
2840are used in other contexts too. For example, the hook 2840minor modes also run a mode hook at their end. But hooks are used in
2841@code{suspend-hook} runs just before Emacs suspends itself 2841other contexts too. For example, the hook @code{suspend-hook} runs
2842(@pxref{Suspending Emacs}). 2842just before Emacs suspends itself (@pxref{Suspending Emacs}).
2843 2843
2844 The recommended way to add a hook function to a normal hook is by 2844 The recommended way to add a hook function to a normal hook is by
2845calling @code{add-hook} (see below). The hook functions may be any of 2845calling @code{add-hook} (see below). The hook functions may be any of
@@ -2937,6 +2937,10 @@ executed first (barring another @code{add-hook} call). If the optional
2937argument @var{append} is non-@code{nil}, the new hook function goes at 2937argument @var{append} is non-@code{nil}, the new hook function goes at
2938the end of the hook list and will be executed last. 2938the end of the hook list and will be executed last.
2939 2939
2940@code{add-hook} can handle the cases where @var{hook} is void or its
2941value is a single function; it sets or changes the value to a list of
2942functions.
2943
2940If @var{local} is non-@code{nil}, that says to add @var{function} to 2944If @var{local} is non-@code{nil}, that says to add @var{function} to
2941the buffer-local hook list instead of to the global hook list. If 2945the buffer-local hook list instead of to the global hook list. If
2942needed, this makes the hook buffer-local and adds @code{t} to the 2946needed, this makes the hook buffer-local and adds @code{t} to the