From: Luc Teirlinck Date: Sat, 14 May 2005 15:25:38 +0000 (+0000) Subject: (Hooks): Most minor modes run mode hooks too. X-Git-Tag: ttn-vms-21-2-B4~298 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c71f84bd99f89004fed48064305b5f79ff13139f;p=emacs.git (Hooks): Most minor modes run mode hooks too. `add-hook' can handle void hooks or hooks whose value is a single function. --- 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. Every major mode function is supposed to run a normal hook called the @dfn{mode hook} as the last step of initialization. This makes it easy for a user to customize the behavior of the mode, by overriding the -buffer-local variable assignments already made by the mode. But hooks -are used in other contexts too. For example, the hook -@code{suspend-hook} runs just before Emacs suspends itself -(@pxref{Suspending Emacs}). +buffer-local variable assignments already made by the mode. Most +minor modes also run a mode hook at their end. But hooks are used in +other contexts too. For example, the hook @code{suspend-hook} runs +just before Emacs suspends itself (@pxref{Suspending Emacs}). The recommended way to add a hook function to a normal hook is by calling @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 argument @var{append} is non-@code{nil}, the new hook function goes at the end of the hook list and will be executed last. +@code{add-hook} can handle the cases where @var{hook} is void or its +value is a single function; it sets or changes the value to a list of +functions. + If @var{local} is non-@code{nil}, that says to add @var{function} to the buffer-local hook list instead of to the global hook list. If needed, this makes the hook buffer-local and adds @code{t} to the