diff options
| author | Glenn Morris | 2011-02-28 19:05:28 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-02-28 19:05:28 -0800 |
| commit | 6640b281f372aebe09d0e323b79a9aa7c311fcc2 (patch) | |
| tree | f18250d5164ee22f85af3d5668ece566de9871ff /doc | |
| parent | cead857b3afcf0ed0166f397cb69c478a6c368f6 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/custom.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 8 |
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 @@ | |||
| 1 | 2011-03-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * custom.texi (Directory Variables): | ||
| 4 | Give an example of excluding subdirectories. | ||
| 5 | |||
| 1 | 2011-02-28 Eli Zaretskii <eliz@gnu.org> | 6 | 2011-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. | |||
| 1340 | This example shows some settings for a hypothetical project. It sets | 1341 | This 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 |
| 1342 | any file in the project's directory tree, and it sets the indentation | 1343 | any file in the project's directory tree, and it sets the indentation |
| 1343 | style for any C or Java source file. Finally, it specifies a different | 1344 | style 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} | 1345 | indicates that the Java mode settings are only to be applied in the |
| 1346 | current directory, not in any subdirectories. Finally, it specifies a | ||
| 1347 | different @file{ChangeLog} file name for any file in the @file{src/imported} | ||
| 1345 | subdirectory of the directory where you put the @file{.dir-locals.el} | 1348 | subdirectory of the directory where you put the @file{.dir-locals.el} |
| 1346 | file. | 1349 | file. |
| 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 @@ | |||
| 1 | 2011-03-01 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * variables.texi (Directory Local Variables): | ||
| 4 | Mention `(subdirs . nil)' alist element. | ||
| 5 | |||
| 1 | 2011-02-28 Glenn Morris <rgm@gnu.org> | 6 | 2011-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 | |||
| 1718 | The MS-DOS version of Emacs uses @file{_dir-locals.el} instead, due to | 1718 | The MS-DOS version of Emacs uses @file{_dir-locals.el} instead, due to |
| 1719 | limitations of the DOS filesystems. | 1719 | limitations 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 |
| 1721 | settings to any file in that directory or any of its subdirectories. | 1721 | settings to any file in that directory or any of its subdirectories |
| 1722 | (optionally, you can exclude subdirectories; see below). | ||
| 1722 | If some of the subdirectories have their own @file{.dir-locals.el} | 1723 | If some of the subdirectories have their own @file{.dir-locals.el} |
| 1723 | files, Emacs uses the settings from the deepest file it finds starting | 1724 | files, Emacs uses the settings from the deepest file it finds starting |
| 1724 | from the file's directory and moving up the directory tree. The file | 1725 | 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}, | |||
| 1749 | then the all the variables in the associated @var{alist} are applied; | 1750 | then 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})}. |
| 1751 | A special value @code{nil} for @var{major-mode} means the settings are | 1752 | A special value @code{nil} for @var{major-mode} means the settings are |
| 1752 | applicable to any mode. | 1753 | applicable 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 | ||
| 1756 | directory, not to those in any subdirectories. | ||
| 1753 | 1757 | ||
| 1754 | With the second form of @var{variables}, if @var{directory} is the | 1758 | With the second form of @var{variables}, if @var{directory} is the |
| 1755 | initial substring of the file's directory, then @var{list} is applied | 1759 | initial substring of the file's directory, then @var{list} is applied |