How to set a directory local variable for a directory itself non-recursively? I don't want the variable set in .dir-locals.el
affect the sub-directories.
Edited:
My use case is: I'd like to hide dot files under ~
by setting dired-omit-files
since there are quite a lot of them in my home directory. But I do not want to hide dot files of any other subdirectory of ~
. Though I think I can set it using some dired-mode-hook
by comparing buffer-name
or buffer-file-name
, I guessed there may be simpler solution by using directory local variables.
(string= (expand-file-name dired-directory) (expand-file-name "~/"))
to see whether the current dired buffer is visiting your home directory.