all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <i.lohmar@gmail.com>
To: 16635@debbugs.gnu.org
Subject: bug#16635: [PATCH] help-fns.el fix describe-variable of dir-local var set in elisp
Date: Mon, 03 Feb 2014 22:23:12 +0100	[thread overview]
Message-ID: <87r47jvqkf.fsf@acer.localhost.com> (raw)

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






             reply	other threads:[~2014-02-03 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 21:23 Ingo Lohmar [this message]
2014-02-08  2:18 ` bug#16635: [PATCH] help-fns.el fix describe-variable of dir-local var set in elisp Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r47jvqkf.fsf@acer.localhost.com \
    --to=i.lohmar@gmail.com \
    --cc=16635@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.