summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-11-07 13:54:56 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-11-10 13:04:31 +0000
commit2e8488858c7b8df40610c1cd3038348fdc9bf3ed (patch)
tree071562f68f773d55bd40a4f861a0d90c5f4c9ddf /lisp/help-fns.el
parentcbaa04014e0c9efdfc6393bccde0e6579b5d7051 (diff)
downloademacs-2e8488858c7b8df40610c1cd3038348fdc9bf3ed.tar.gz
* lisp/files.el (dir-locals-file): Allow wildcards
(dir-locals-find-file, dir-locals-collect-variables) (dir-locals-read-from-file): Update accordingly. (hack-dir-local-variables): Rename a local variable. * lisp/files-x.el (modify-dir-local-variable): Update accordingly * lisp/help-fns.el (describe-variable): Update accordingly * .gitignore: Add .dir-locals?.el
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el43
1 files changed, 25 insertions, 18 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 958a0754946..4e0bfee5bf7 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -907,29 +907,36 @@ if it is given a local binding.\n"))))
(buffer-file-name buffer)))
(dir-locals-find-file
(buffer-file-name buffer))))
- (dir-file t))
+ (is-directory nil))
(princ (substitute-command-keys
" This variable's value is directory-local"))
- (if (null file)
- (princ ".\n")
- (princ ", set ")
- (if (consp file) ; result from cache
- ;; If the cache element has an mtime, we
- ;; assume it came from a file.
- (if (nth 2 file)
- (setq file (expand-file-name
- dir-locals-file (car file)))
- ;; Otherwise, assume it was set directly.
- (setq file (car file)
- dir-file nil)))
- (princ (substitute-command-keys
- (if dir-file
- "by the file\n `"
- "for the directory\n `")))
+ (when (consp file) ; result from cache
+ ;; If the cache element has an mtime, we
+ ;; assume it came from a file.
+ (if (nth 2 file)
+ (setq file (expand-file-name
+ dir-locals-file (car file)))
+ ;; Otherwise, assume it was set directly.
+ (setq file (car file)
+ is-directory t)))
+ (if (null file)
+ (princ ".\n")
+ (princ ", set ")
+ (let ((files (file-expand-wildcards file)))
+ (princ (substitute-command-keys
+ (cond
+ (is-directory "for the directory\n `")
+ ;; Many files matched.
+ ((cdr files)
+ (setq file (file-name-directory (car files)))
+ (format "by a file\n matching `%s' in the directory\n `"
+ dir-locals-file))
+ (t (setq file (car files))
+ "by the file\n `"))))
(with-current-buffer standard-output
(insert-text-button
file 'type 'help-dir-local-var-def
- 'help-args (list variable file)))
+ 'help-args (list variable file))))
(princ (substitute-command-keys "'.\n"))))
(princ (substitute-command-keys
" This variable's value is file-local.\n"))))