* lisp/dired-x.el (dired-omit-here-always): Use add-dir-local-variable
instead of manually writing a dir-locals file.
This commit is contained in:
parent
f0b82b3453
commit
71ecd62937
1 changed files with 6 additions and 8 deletions
|
@ -816,16 +816,14 @@ If in a Dired buffer, reverts it."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (file-exists-p dired-local-variables-file)
|
(if (file-exists-p dired-local-variables-file)
|
||||||
(error "Old-style dired-local-variables-file `./%s' found;
|
(error "Old-style dired-local-variables-file `./%s' found;
|
||||||
replace it with a dir-locals-file `./%s'"
|
replace it with a dir-locals-file `./%s.el'"
|
||||||
dired-local-variables-file
|
dired-local-variables-file
|
||||||
dir-locals-file))
|
dir-locals-file))
|
||||||
(if (file-exists-p dir-locals-file)
|
(if (dir-locals--all-files default-directory)
|
||||||
(message "File `./%s' already exists." dir-locals-file)
|
(message "File `./%s' already exists."
|
||||||
(with-temp-buffer
|
(car (dir-locals--all-files default-directory)))
|
||||||
(insert "\
|
(add-dir-local-variable 'dired-mode 'subdirs nil)
|
||||||
\((dired-mode . ((subdirs . nil)
|
(add-dir-local-variable 'dired-mode 'dired-omit-mode t)
|
||||||
(dired-omit-mode . t))))\n")
|
|
||||||
(write-file dir-locals-file))
|
|
||||||
;; Run extra-hooks and revert directory.
|
;; Run extra-hooks and revert directory.
|
||||||
(when (derived-mode-p 'dired-mode)
|
(when (derived-mode-p 'dired-mode)
|
||||||
(hack-dir-local-variables-non-file-buffer)
|
(hack-dir-local-variables-non-file-buffer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue