unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16635: [PATCH] help-fns.el fix describe-variable of dir-local var set in elisp
@ 2014-02-03 21:23 Ingo Lohmar
  2014-02-08  2:18 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Lohmar @ 2014-02-03 21:23 UTC (permalink / raw)
  To: 16635

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  `"))






^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-08  2:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 21:23 bug#16635: [PATCH] help-fns.el fix describe-variable of dir-local var set in elisp Ingo Lohmar
2014-02-08  2:18 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).