summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2016-01-16 08:50:46 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2016-01-16 08:53:33 +0000
commitf0b82b34536e6bafbecbd642eee0cb0f534f8647 (patch)
treec717d188a43e9166507111451700bff13194a551 /lisp/files.el
parent86e45139698fe773ffb4efbe59387f90201b80c8 (diff)
downloademacs-f0b82b34536e6bafbecbd642eee0cb0f534f8647.tar.gz
* 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.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el23
1 files changed, 13 insertions, 10 deletions
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.