emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1e98f04 3/4: * lisp/files.el (dir-locals-find-file)


From: Artur Malabarba
Subject: [Emacs-diffs] master 1e98f04 3/4: * lisp/files.el (dir-locals-find-file): Don't stop at unreadable files
Date: Tue, 10 Nov 2015 12:05:21 +0000

branch: master
commit 1e98f041acae7cee012b1b157d4aa3f80b226123
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    * lisp/files.el (dir-locals-find-file): Don't stop at unreadable files
    
    `locate-dominating-file' will now keep looking if the files it finds in
    a given directory are unreadable (or not files).
---
 lisp/files.el |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index e8ee949..58ed357 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3751,26 +3751,16 @@ wildcards, then the return value is not a proper 
filename, it is
 an absolute version of `dir-locals-file' which is guaranteed to
 expand to at least one file."
   (setq file (expand-file-name file))
-  (let* ((dir-locals-file-name (if (eq system-type 'ms-dos)
-                                   (dosified-file-name dir-locals-file)
-                                 dir-locals-file))
-         (locals-dir (locate-dominating-file
-                      (file-name-directory file)
-                      (lambda (dir)
-                        (let ((default-directory dir))
-                          (file-expand-wildcards dir-locals-file-name 
'full)))))
+  (let* ((locals-dir (locate-dominating-file (file-name-directory file)
+                                             #'dir-locals--all-files))
          locals-file dir-elt)
     ;; `locate-dominating-file' may have abbreviated the name.
     (when locals-dir
       (setq locals-dir (expand-file-name locals-dir))
-      (setq locals-file (expand-file-name dir-locals-file-name locals-dir)))
-    ;; Let dir-locals-read-from-file inform us via demoted-errors
-    ;; about unreadable files, etc.
-    ;; Maybe we'd want to keep searching though - that is
-    ;; a locate-dominating-file issue.
-;;;     (or (not (file-readable-p locals-file))
-;;;         (not (file-regular-p locals-file)))
-;;;     (setq locals-file nil))
+      (setq locals-file (expand-file-name (if (eq system-type 'ms-dos)
+                                              (dosified-file-name 
dir-locals-file)
+                                            dir-locals-file)
+                                          locals-dir)))
     ;; Find the best cached value in `dir-locals-directory-cache'.
     (dolist (elt dir-locals-directory-cache)
       (when (and (string-prefix-p (car elt) file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]