GNU bug report logs - #16635
[PATCH] help-fns.el fix describe-variable of dir-local var set in elisp

Previous Next

Package: emacs;

Reported by: Ingo Lohmar <i.lohmar <at> gmail.com>

Date: Mon, 3 Feb 2014 21:26:01 UTC

Severity: normal

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16635 in the body.
You can then email your comments to 16635 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16635; Package emacs. (Mon, 03 Feb 2014 21:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ingo Lohmar <i.lohmar <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 03 Feb 2014 21:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ingo Lohmar <i.lohmar <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] help-fns.el fix describe-variable of dir-local var set in
 elisp
Date: Mon, 03 Feb 2014 22:23:12 +0100
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 sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 08 Feb 2014 02:19:02 GMT) Full text and rfc822 format available.

Notification sent to Ingo Lohmar <i.lohmar <at> gmail.com>:
bug acknowledged by developer. (Sat, 08 Feb 2014 02:19:02 GMT) Full text and rfc822 format available.

Message #10 received at 16635-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 16635-done <at> debbugs.gnu.org
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
Version: 24.4

Thanks; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 08 Mar 2014 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 73 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.