From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ingo Lohmar Newsgroups: gmane.emacs.bugs 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 Message-ID: <87r47jvqkf.fsf@acer.localhost.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391462778 5621 80.91.229.3 (3 Feb 2014 21:26:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Feb 2014 21:26:18 +0000 (UTC) To: 16635@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 03 22:26:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WAR27-0004fH-EJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Feb 2014 22:26:23 +0100 Original-Received: from localhost ([::1]:49655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAR26-0006MK-VJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Feb 2014 16:26:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAR1v-0006LJ-Vt for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:26:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAR1m-00006j-DU for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:26:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAR1m-00006e-A3 for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WAR1m-0007rY-2J for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ingo Lohmar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Feb 2014 21:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16635 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139146275330201 (code B ref -1); Mon, 03 Feb 2014 21:26:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Feb 2014 21:25:53 +0000 Original-Received: from localhost ([127.0.0.1]:48367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAR1c-0007r2-V5 for submit@debbugs.gnu.org; Mon, 03 Feb 2014 16:25:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42412) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAQzW-0007nM-JZ for submit@debbugs.gnu.org; Mon, 03 Feb 2014 16:23:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAQzN-0007cn-QD for submit@debbugs.gnu.org; Mon, 03 Feb 2014 16:23:42 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAQzN-0007cj-Mn for submit@debbugs.gnu.org; Mon, 03 Feb 2014 16:23:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAQzF-0004Nh-9A for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:23:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAQz6-0007ZZ-SI for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:23:25 -0500 Original-Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]:47420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAQz6-0007Yb-LG for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 16:23:16 -0500 Original-Received: by mail-ee0-f49.google.com with SMTP id d17so3892137eek.8 for ; Mon, 03 Feb 2014 13:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; bh=XDVzhuaqk7GayD+7JNwpwAj9G4wxALMKe3E5NkEpaOk=; b=fZo3ilaefVryM2Vofe7jb9xp/8dpc8UBHMx9JtXeMaLtfwYfzeB7H0Ri2fXL2Aq5wE K4BKXLl2n/BrAi2uw61x7dfdFh0evZtPT6OQ5y5glLaMBPe9D5wdlUojuSACXUg1R5qM vYflVXnSJk93UzgPEI4TJnwX3c0ATqvZNA2UAS16qnqrx9jITsjSYbNIK5kCEPZAp7Uv xMDAVRM76kJ+laLvw8Su/OtaMPq5d+u50TyzpzYrhdVzYlQb/wB96YsJRLqfkQ/+3uxy 1PoEvmHEZRpfe6Uchs1xF9OfbL4E2Xrd4awfhQ/5+ayrjxSLXR0l1rVVPFVE0VVssxDs OwiA== X-Received: by 10.14.179.73 with SMTP id g49mr5426019eem.71.1391462595551; Mon, 03 Feb 2014 13:23:15 -0800 (PST) Original-Received: from localhost (koln-d932a117.pool.mediaWays.net. [217.50.161.23]) by mx.google.com with ESMTPSA id k6sm80211070eep.17.2014.02.03.13.23.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Feb 2014 13:23:14 -0800 (PST) User-Agent: Notmuch/0.14+777~g437f130 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Mon, 03 Feb 2014 16:25:47 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84517 Archived-At: 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 `"))