aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGlenn Morris2011-02-28 19:05:28 -0800
committerGlenn Morris2011-02-28 19:05:28 -0800
commit6640b281f372aebe09d0e323b79a9aa7c311fcc2 (patch)
treef18250d5164ee22f85af3d5668ece566de9871ff /doc
parentcead857b3afcf0ed0166f397cb69c478a6c368f6 (diff)
downloademacs-6640b281f372aebe09d0e323b79a9aa7c311fcc2.tar.gz
emacs-6640b281f372aebe09d0e323b79a9aa7c311fcc2.zip
Add the ability to exclude dir-locals from subdirs. (Bug#8100)
* lisp/files.el (dir-locals-collect-variables): Add the ability to exclude subdirectories. * doc/emacs/custom.texi (Directory Variables): Give an example of excluding subdirectories. * doc/lispref/variables.texi (Directory Local Variables): Mention `(subdirs . nil)' alist element. * etc/NEWS: Mention this addition. * lisp/dired-x.el (dired-omit-here-always): Add `(subdirs . nil)' to locals.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/custom.texi9
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/variables.texi8
4 files changed, 22 insertions, 5 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 7a9c3ae3a47..8b94bf8f6dd 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12011-03-01 Glenn Morris <rgm@gnu.org>
2
3 * custom.texi (Directory Variables):
4 Give an example of excluding subdirectories.
5
12011-02-28 Eli Zaretskii <eliz@gnu.org> 62011-02-28 Eli Zaretskii <eliz@gnu.org>
2 7
3 * search.texi (Regexp Search): Move index entries about regexps to the 8 * search.texi (Regexp Search): Move index entries about regexps to the
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index dfd55b13f18..9304e8bef08 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1331,7 +1331,8 @@ corresponding alist applies to all the files in that subdirectory.
1331 (tab-width . 4) 1331 (tab-width . 4)
1332 (fill-column . 80))) 1332 (fill-column . 80)))
1333 (c-mode . ((c-file-style . "BSD"))) 1333 (c-mode . ((c-file-style . "BSD")))
1334 (java-mode . ((c-file-style . "BSD"))) 1334 (java-mode . ((c-file-style . "BSD")
1335 (subdirs . nil)))
1335 ("src/imported" 1336 ("src/imported"
1336 . ((nil . ((change-log-default-name . "ChangeLog.local")))))) 1337 . ((nil . ((change-log-default-name . "ChangeLog.local"))))))
1337@end example 1338@end example
@@ -1340,8 +1341,10 @@ corresponding alist applies to all the files in that subdirectory.
1340This example shows some settings for a hypothetical project. It sets 1341This example shows some settings for a hypothetical project. It sets
1341@samp{indent-tabs-mode}, @code{tab-width}, and @code{fill-column} for 1342@samp{indent-tabs-mode}, @code{tab-width}, and @code{fill-column} for
1342any file in the project's directory tree, and it sets the indentation 1343any file in the project's directory tree, and it sets the indentation
1343style for any C or Java source file. Finally, it specifies a different 1344style for any C or Java source file. The special @code{subdirs} element
1344@file{ChangeLog} file name for any file in the @file{src/imported} 1345indicates that the Java mode settings are only to be applied in the
1346current directory, not in any subdirectories. Finally, it specifies a
1347different @file{ChangeLog} file name for any file in the @file{src/imported}
1345subdirectory of the directory where you put the @file{.dir-locals.el} 1348subdirectory of the directory where you put the @file{.dir-locals.el}
1346file. 1349file.
1347 1350
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index c8925715f74..1a980f14f3d 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12011-03-01 Glenn Morris <rgm@gnu.org>
2
3 * variables.texi (Directory Local Variables):
4 Mention `(subdirs . nil)' alist element.
5
12011-02-28 Glenn Morris <rgm@gnu.org> 62011-02-28 Glenn Morris <rgm@gnu.org>
2 7
3 * variables.texi (Directory Local Variables): Mention the optional 8 * variables.texi (Directory Local Variables): Mention the optional
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index c6af304416c..a68b2b6dd4e 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1718,7 +1718,8 @@ directory-local variables. The name of the file is
1718The MS-DOS version of Emacs uses @file{_dir-locals.el} instead, due to 1718The MS-DOS version of Emacs uses @file{_dir-locals.el} instead, due to
1719limitations of the DOS filesystems. 1719limitations of the DOS filesystems.
1720}. A file by that name in a directory causes Emacs to apply its 1720}. A file by that name in a directory causes Emacs to apply its
1721settings to any file in that directory or any of its subdirectories. 1721settings to any file in that directory or any of its subdirectories
1722(optionally, you can exclude subdirectories; see below).
1722If some of the subdirectories have their own @file{.dir-locals.el} 1723If some of the subdirectories have their own @file{.dir-locals.el}
1723files, Emacs uses the settings from the deepest file it finds starting 1724files, Emacs uses the settings from the deepest file it finds starting
1724from the file's directory and moving up the directory tree. The file 1725from 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},
1749then the all the variables in the associated @var{alist} are applied; 1750then the all the variables in the associated @var{alist} are applied;
1750@var{alist} should be of the form @code{(@var{name} . @var{value})}. 1751@var{alist} should be of the form @code{(@var{name} . @var{value})}.
1751A special value @code{nil} for @var{major-mode} means the settings are 1752A special value @code{nil} for @var{major-mode} means the settings are
1752applicable to any mode. 1753applicable to any mode. In @var{alist}, you can use a special
1754@var{name}: @code{subdirs}. If the associated value is
1755@code{nil}, the alist is only applied to files in the relevant
1756directory, not to those in any subdirectories.
1753 1757
1754With the second form of @var{variables}, if @var{directory} is the 1758With the second form of @var{variables}, if @var{directory} is the
1755initial substring of the file's directory, then @var{list} is applied 1759initial substring of the file's directory, then @var{list} is applied