Commit 291703b5 authored by Eli Zaretskii's avatar Eli Zaretskii

(File Local Variables): Document `file-local-variables-alist',

`before-hack-local-variables-hook' and `hack-local-variables-hook'.
parent 66af33fc
2008-10-19 Eli Zaretskii <eliz@gnu.org>
* hooks.texi (Standard Hooks): Mention
`before-hack-local-variables-hook' and `hack-local-variables-hook'.
* variables.texi (File Local Variables): Document
`file-local-variables-alist', `before-hack-local-variables-hook'
and `hack-local-variables-hook'.
* processes.texi (Synchronous Processes): Document `process-lines'.
* customize.texi (Variable Definitions): Document
......
......@@ -1577,12 +1577,38 @@ function does not look for the @samp{mode:} local variable in the
@w{@samp{-*-}} line. @code{set-auto-mode} does that, also taking
@code{enable-local-variables} into account (@pxref{Auto Major Mode}).
This function works by walking the alist stored in
@code{file-local-variables-alist}, and applies each local variable in
turn. It calls @code{before-hack-local-variables-hook} and
@code{hack-local-variables-hook} before and after applying the
variables, respectively.
If the optional argument @var{mode-only} is non-@code{nil}, then all
this function does is return @code{t} if the @w{@samp{-*-}} line or
the local variables list specifies a mode and @code{nil} otherwise.
It does not set the mode nor any other file local variable.
@end defun
@defvar file-local-variables-alist
This buffer-local variable holds the alist of file-local variable
settings. Each element of the alist is of the form
@w{@code{(@var{var} . @var{value})}}, where @var{var} is a symbol of
the local variable and @var{value} is its value. When Emacs visits a
file, it first collects all the file-local variables into this alist,
and then the @code{hack-local-variables} function applies them one by
one.
@end defvar
@defvar before-hack-local-variables-hook
Emacs calls this hook immediately before applying file-local variables
stored in @code{file-local-variables-alist}.
@end defvar
@defvar hack-local-variables-hook
Emacs calls this hook immediately after it finishes applying
file-local variables stored in @code{file-local-variables-alist}.
@end defvar
If a file local variable could specify a function that would
be called later, or an expression that would be executed later, simply
visiting a file could take over your Emacs. Emacs takes several
......
......@@ -1316,6 +1316,10 @@ unless it ends in whitespace.
*** set-file-modes is now interactive and can take the mode value in
symbolic notation thanks to auxiliary functions.
+++
*** file-local-variables-alist stores an alist of file-local
variables defined in the current buffer.
** Process changes
+++
*** The new function `start-file-process' is similar to `start-process',
......@@ -1391,9 +1395,6 @@ a character code property.
*** New variables:
**** file-local-variables-alist stores an alist of file-local
variables defined in the current buffer.
**** `find-word-boundary-function-table' is a char-table of functions to
search for a word boundary.
......@@ -1528,6 +1529,7 @@ which is not used directly any more.
*** New hooks:
+++
**** before-hack-local-variables-hook is called after setting new
variable file-local-variables-alist, and before actually applying the
file-local variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment