Add the ability to exclude dir-locals from subdirs. (Bug#8100)
[bpt/emacs.git] / doc / lispref / variables.texi
index c6af304..a68b2b6 100644 (file)
@@ -1718,7 +1718,8 @@ directory-local variables.  The name of the file is
 The MS-DOS version of Emacs uses @file{_dir-locals.el} instead, due to
 limitations of the DOS filesystems.
 }.  A file by that name in a directory causes Emacs to apply its
-settings to any file in that directory or any of its subdirectories.
+settings to any file in that directory or any of its subdirectories
+(optionally, you can exclude subdirectories; see below).
 If some of the subdirectories have their own @file{.dir-locals.el}
 files, Emacs uses the settings from the deepest file it finds starting
 from the file's directory and moving up the directory tree.  The file
@@ -1749,7 +1750,10 @@ file's buffer turns on a mode that is derived from @var{major-mode},
 then the all the variables in the associated @var{alist} are applied;
 @var{alist} should be of the form @code{(@var{name} . @var{value})}.
 A special value @code{nil} for @var{major-mode} means the settings are
-applicable to any mode.
+applicable to any mode.  In @var{alist}, you can use a special
+@var{name}: @code{subdirs}.  If the associated value is
+@code{nil}, the alist is only applied to files in the relevant
+directory, not to those in any subdirectories.
 
 With the second form of @var{variables}, if @var{directory} is the
 initial substring of the file's directory, then @var{list} is applied