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
commit6640b281f372aebe09d0e323b79a9aa7c311fcc2 (patch)
treef18250d5164ee22f85af3d5668ece566de9871ff /lisp/dired-x.el
parentcead857b3afcf0ed0166f397cb69c478a6c368f6 (diff)
downloademacs-6640b281f372aebe09d0e323b79a9aa7c311fcc2.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)