Commit 61086eb6 authored by Glenn Morris's avatar Glenn Morris
Browse files

Document inhibit-local-variables-regexps in the lispref.

* doc/lispref/modes.texi (Auto Major Mode):
* doc/lispref/variables.texi (File Local Variables):
Mention inhibit-local-variables-regexps.

* etc/NEWS: Markup.
parent dd6f2a63
2012-01-21 Glenn Morris <>
* modes.texi (Auto Major Mode):
* variables.texi (File Local Variables):
Mention inhibit-local-variables-regexps.
2012-01-19 Martin Rudalics <>
* windows.texi (Window Configurations): Rewrite references to
......@@ -588,6 +588,18 @@ Chosen, emacs, The GNU Emacs Manual}. If @code{enable-local-variables}
is @code{nil}, @code{set-auto-mode} does not check the @w{@samp{-*-}}
line, or near the end of the file, for any mode tag.
@vindex inhibit-local-variables-regexps
There are some file types where it is not appropriate to scan the file
contents for a mode specifier. For example, a tar archive may happen to
contain, near the end of the file, a member file that has a local
variables section specifying a mode for that particular file. This
should not be applied to the containing tar file. Similarly, a tiff
image file might just happen to contain a first line that seems to
match the @w{@samp{-*-}} pattern. For these reasons, both these file
extensions are members of the list @var{inhibit-local-variables-regexps}.
Add patterns to this list to prevent Emacs searching them for local
variables of any kind (not just mode specifiers).
If @var{keep-mode-if-same} is non-@code{nil}, this function does not
call the mode command if the buffer is already in the proper major
mode. For instance, @code{set-visited-file-name} sets this to
......@@ -1660,6 +1660,13 @@ Query (once) about all the variables.
@end table
@end defopt
@defvar inhibit-local-variables-regexps
This is a list of regular expressions. If a file has a name
matching an element of this list, then it is not scanned for
any form of file-local variable. For examples of why you might want
to use this, @pxref{Auto Major Mode}.
@end defvar
@defun hack-local-variables &optional mode-only
This function parses, and binds or evaluates as appropriate, any local
variables specified by the contents of the current buffer. The variable
......@@ -369,8 +369,7 @@ turn on `whitespace-mode' for *vc-diff* buffers. Modes should call
*** Using "mode: MINOR-MODE" to enable a minor mode is deprecated.
Instead, use "eval: (minor-mode 1)".
FIXME: inhibit-first-line-modes-regexps was not mentioned in lispref,
but this probably should be.
*** The variable `inhibit-first-line-modes-regexps' has been renamed
to `inhibit-local-variables-regexps'. As the name suggests, it now
applies to ALL file local variables, not just -*- mode ones.
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