summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-02-24 00:26:25 -0800
committerGlenn Morris <rgm@gnu.org>2011-02-24 00:26:25 -0800
commit303f9ae0146c9bc42985e98a07b86be0cb1c6eca (patch)
tree32549acad8ede71e4d5c62ecbf852d6e31290868 /lisp/help-fns.el
parent07915ed93c1a21776f7371e615b43d0d79eaebfd (diff)
downloademacs-303f9ae0146c9bc42985e98a07b86be0cb1c6eca.tar.gz
emacs-303f9ae0146c9bc42985e98a07b86be0cb1c6eca.tar.bz2
emacs-303f9ae0146c9bc42985e98a07b86be0cb1c6eca.zip
Fix for another bit of bug#8095, re dir-locals.
* lisp/help-fns.el (describe-variable): Return consistent results when a dir-local from a file came from the cache or did not. If a dir-local has no associated file, say it came from a "directory".
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el20
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 1cd5526fcff..38e331dc992 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -748,15 +748,21 @@ it is displayed along with the global value."
(setq extra-line t)
(if (member (cons variable val) dir-local-variables-alist)
(let ((file (and (buffer-file-name)
- (not (file-remote-p (buffer-file-name)))
- (dir-locals-find-file (buffer-file-name)))))
+ (not (file-remote-p (buffer-file-name)))
+ (dir-locals-find-file
+ (buffer-file-name))))
+ (type "file"))
(princ " This variable is a directory local variable")
(when file
- (princ (concat "\n from the file \""
- (if (consp file)
- (car file)
- file)
- "\"")))
+ (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 type "directory")))
+ (princ (format "\n from the %s \"%s\"" type file)))
(princ ".\n"))
(princ " This variable is a file local variable.\n")))