aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorStefan Monnier2002-02-12 19:33:46 +0000
committerStefan Monnier2002-02-12 19:33:46 +0000
commit89cda0c5e9df20e7caebd110891e93957c7e6b4a (patch)
tree6360bb8a1d1c222c4ce0726f1e50b4421fdf4a2d /lispref
parent9a770d8d3356a72a4b66b256cc629ea97951306c (diff)
downloademacs-89cda0c5e9df20e7caebd110891e93957c7e6b4a.tar.gz
emacs-89cda0c5e9df20e7caebd110891e93957c7e6b4a.zip
*** empty log message ***
Diffstat (limited to 'lispref')
-rw-r--r--lispref/modes.texi30
-rw-r--r--lispref/variables.texi4
2 files changed, 8 insertions, 26 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 8a6978ebacf..299595341f8 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2206,8 +2206,9 @@ then the value is a list of functions, but it is abnormal in that either
2206these functions are called with arguments or their values are used in 2206these functions are called with arguments or their values are used in
2207some way. You can use @code{add-hook} to add a function to the list, 2207some way. You can use @code{add-hook} to add a function to the list,
2208but you must take care in writing the function. (A few of these 2208but you must take care in writing the function. (A few of these
2209variables are actually normal hooks which were named before we 2209variables, notably those ending in @samp{-hooks}, are actually
2210established the convention of using @samp{-hook} for them.) 2210normal hooks which were named before we established the convention of
2211using @samp{-hook} for them.)
2211 2212
2212 If the variable's name ends in @samp{-function}, then its value 2213 If the variable's name ends in @samp{-function}, then its value
2213is just a single function, not a list of functions. 2214is just a single function, not a list of functions.
@@ -2290,9 +2291,8 @@ executed first (barring another @code{add-hook} call). If the optional
2290argument @var{append} is non-@code{nil}, the new hook function goes at 2291argument @var{append} is non-@code{nil}, the new hook function goes at
2291the end of the hook list and will be executed last. 2292the end of the hook list and will be executed last.
2292 2293
2293If @var{local} is non-@code{nil}, that says to make the new hook 2294If @var{local} is non-@code{nil}, that says to add @var{function}
2294function buffer-local in the current buffer and automatically calls 2295to the buffer-local hook list instead of to the global hook list.
2295@code{make-local-hook} to make the hook itself buffer-local.
2296@end defun 2296@end defun
2297 2297
2298@defun remove-hook hook function &optional local 2298@defun remove-hook hook function &optional local
@@ -2300,24 +2300,4 @@ This function removes @var{function} from the hook variable @var{hook}.
2300 2300
2301If @var{local} is non-@code{nil}, that says to remove @var{function} 2301If @var{local} is non-@code{nil}, that says to remove @var{function}
2302from the buffer-local hook list instead of from the global hook list. 2302from the buffer-local hook list instead of from the global hook list.
2303If the hook variable itself is not buffer-local, then the value of
2304@var{local} makes no difference.
2305@end defun
2306
2307@defun make-local-hook hook
2308This function makes the hook variable @code{hook} buffer-local in the
2309current buffer. When a hook variable is buffer-local, it can have
2310buffer-local and global hook functions, and @code{run-hooks} runs all of
2311them.
2312
2313This function works by adding @code{t} as an element of the buffer-local
2314value. That serves as a flag to use the hook functions listed in the default
2315value of the hook variable, as well as those listed in the buffer-local value.
2316Since @code{run-hooks} understands this flag, @code{make-local-hook}
2317works with all normal hooks. It works for only some non-normal
2318hooks---those whose callers have been updated to understand this meaning
2319of @code{t}.
2320
2321Do not use @code{make-local-variable} directly for hook variables; it is
2322not sufficient.
2323@end defun 2303@end defun
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 5d19cbefd0e..df816f85b68 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1291,7 +1291,9 @@ variables cannot have buffer-local bindings as well. @xref{Multiple
1291Displays}. 1291Displays}.
1292 1292
1293@strong{Note:} Do not use @code{make-local-variable} for a hook 1293@strong{Note:} Do not use @code{make-local-variable} for a hook
1294variable. Instead, use @code{make-local-hook}. @xref{Hooks}. 1294variable. The hook variables are automatically made buffer-local
1295as needed if you use the @var{local} argument to @code{add-hook} or
1296@code{remove-hook}.
1295@end deffn 1297@end deffn
1296 1298
1297@deffn Command make-variable-buffer-local variable 1299@deffn Command make-variable-buffer-local variable