summaryrefslogtreecommitdiff
path: root/lisp/dired-x.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-02-28 19:05:28 -0800
committerGlenn Morris <rgm@gnu.org>2011-02-28 19:05:28 -0800
commit983c67ad7821bb0dcb165185cd6c0f9425dc9034 (patch)
treea97845de1472bf9574d6fee3ca3a98240fc43218 /lisp/dired-x.el
parentc9fbf7bb094fbb5799dcdaa8fe162ec390e7ddf9 (diff)
downloademacs-983c67ad7821bb0dcb165185cd6c0f9425dc9034.tar.gz
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 'lisp/dired-x.el')
-rw-r--r--lisp/dired-x.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 816beb0034c..9941c7a0db5 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -786,6 +786,7 @@ See also `dired-enable-local-variables'."
'hack-dir-local-variables-non-file-buffer "24.1")
;; Not sure this is worth having a dedicated command for...
+;; See the more general features in files-x.el.
(defun dired-omit-here-always ()
"Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
If in a Dired buffer, reverts it."
@@ -798,7 +799,9 @@ replace it with a dir-locals-file `./%s'"
(if (file-exists-p dir-locals-file)
(message "File `./%s' already exists." dir-locals-file)
(with-temp-buffer
- (insert "((dired-mode . ((dired-omit-mode . t))))\n")
+ (insert "\
+\((dired-mode . ((subdirs . nil)
+ (dired-omit-mode . t))))\n")
(write-file dir-locals-file))
;; Run extra-hooks and revert directory.
(when (derived-mode-p 'dired-mode)