From 8f0a2c84b66ff8d45a9d088a181617417115ec9e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 26 Jan 2021 01:12:45 +0100 Subject: [PATCH] Make subdirs . nil in dir-locals in ~/ work * lisp/files.el (dir-locals-collect-variables): Compare directory names after expanding. This makes a (subdirs . nil) in ~/ work as expected (bug#17205). Test case: ((nil . ((a . "hallo") (subdirs . nil)))) in ~/ --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index 7af5549bcb0..77e3a3a834c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4068,7 +4068,7 @@ Return the new variables list." ;; integer values for subdir, where N means ;; variables apply to this directory and N levels ;; below it (0 == nil). - (equal root default-directory)) + (equal root (expand-file-name default-directory))) (setq variables (dir-locals-collect-mode-variables alist variables)))))))) (error -- 2.39.5