From f0b82b34536e6bafbecbd642eee0cb0f534f8647 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 16 Jan 2016 08:50:46 +0000 Subject: * lisp/files.el (dir-locals--all-files): Use completion instead of wildcards (dir-locals-file) * lisp/files-x.el (modify-dir-local-variable) * lisp/dos-fns.el (dosified-file-name) * lisp/help-fns.el (describe-variable): Change accordingly. --- lisp/files.el | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 9cb46fcd0a9..7c6119b7ef9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3713,7 +3713,7 @@ VARIABLES list of the class. The list is processed in order. applied by recursively following these rules." (setf (alist-get class dir-locals-class-alist) variables)) -(defconst dir-locals-file ".dir-locals*.el" +(defconst dir-locals-file ".dir-locals" "Pattern for files that contain directory-local variables. It has to be constant to enforce uniform values across different environments and users. @@ -3730,16 +3730,19 @@ return a sorted list of all files matching `dir-locals-file' in this directory. The returned list is sorted by `string<' order." (require 'seq) - (let ((default-directory (if (file-directory-p file-or-dir) - file-or-dir - default-directory))) + (let ((dir (if (file-directory-p file-or-dir) + file-or-dir + default-directory)) + (file (cond ((not (file-directory-p file-or-dir)) file-or-dir) + ((eq system-type 'ms-dos) (dosified-file-name dir-locals-file)) + (t dir-locals-file)))) (seq-filter (lambda (f) (and (file-readable-p f) - (file-regular-p f))) - (file-expand-wildcards - (cond ((not (file-directory-p file-or-dir)) file-or-dir) - ((eq system-type 'ms-dos) (dosified-file-name dir-locals-file)) - (t dir-locals-file)) - 'full)))) + (file-regular-p f) + (not (file-directory-p f)))) + (mapcar (lambda (f) (expand-file-name f dir)) + (nreverse + (let ((completion-regexp-list '("\\.el\\'"))) + (file-name-all-completions file dir))))))) (defun dir-locals-find-file (file) "Find the directory-local variables for FILE. -- cgit v1.2.1