--- Begin Message ---
Subject: |
[PATCH] help-fns.el fix describe-variable of dir-local var set in elisp |
Date: |
Mon, 03 Feb 2014 22:23:12 +0100 |
User-agent: |
Notmuch/0.14+777~g437f130 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-pc-linux-gnu) |
Hi all,
describe-variable breaks for a dir-local variable that has been set
directly, ie, not from a file. Minimal example in emacs -Q:
(dir-locals-set-class-variables
'test '((nil . ((tab-width . 7)))))
(dir-locals-set-directory-class default-directory 'test)
;; now open an existing file in the default dir and from its buffer,
;; M-x describe-variable tab-width
;; breaks since on l 940 of help-fns.el, `file' is supposed to be a
;; string, not a cons
The following patch rectifies this by setting `file' to its own car even
if the variable is *not* set from a file. `file' is no longer used
after the sexp that breaks.
* help-fns.el: Fix describe-variable for dir-local var set in elisp
diff --git c/lisp/help-fns.el w/lisp/help-fns.el
index 5e38de8..028f6ac 100644
--- c/lisp/help-fns.el
+++ w/lisp/help-fns.el
@@ -930,7 +930,8 @@ if it is given a local binding.\n")))
(setq file (expand-file-name
dir-locals-file (car file)))
;; Otherwise, assume it was set directly.
- (setq dir-file nil)))
+ (setq file (car file)
+ dir-file nil)))
(princ (if dir-file
"by the file\n `"
"for the directory\n `"))
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#16635: [PATCH] help-fns.el fix describe-variable of dir-local var set in elisp |
Date: |
Fri, 07 Feb 2014 21:18:47 -0500 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Version: 24.4
Thanks; applied.
--- End Message ---