Document inhibit-local-variables-regexps in the lispref.
authorGlenn Morris <rgm@gnu.org>
Sat, 21 Jan 2012 03:15:07 +0000 (19:15 -0800)
committerGlenn Morris <rgm@gnu.org>
Sat, 21 Jan 2012 03:15:07 +0000 (19:15 -0800)
* doc/lispref/modes.texi (Auto Major Mode):
* doc/lispref/variables.texi (File Local Variables):
Mention inhibit-local-variables-regexps.

* etc/NEWS: Markup.

doc/lispref/ChangeLog
doc/lispref/modes.texi
doc/lispref/variables.texi
etc/NEWS

index 44467d5..872c4f5 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-21  Glenn Morris  <rgm@gnu.org>
+
+       * modes.texi (Auto Major Mode):
+       * variables.texi (File Local Variables):
+       Mention inhibit-local-variables-regexps.
+
 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
 
        * windows.texi (Window Configurations): Rewrite references to
index 5d09b79..b3aac23 100644 (file)
@@ -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
index b0a6795..a8f75f5 100644 (file)
@@ -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
index 743e3ce..b22f792 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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.