From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17949: 24.3; .dir-locals.el needs a way to construct paths relative to its own location Date: Tue, 08 Jul 2014 14:17:41 -0400 Message-ID: References: <878uo7pl0x.fsf@naesten.mooo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1404843511 9708 80.91.229.3 (8 Jul 2014 18:18:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Jul 2014 18:18:31 +0000 (UTC) Cc: 17949@debbugs.gnu.org To: Samuel Bronson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 08 20:18:24 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 1X4ZyB-0003RK-KH for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jul 2014 20:18:23 +0200 Original-Received: from localhost ([::1]:57595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4ZyB-0007Xp-3P for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jul 2014 14:18:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Zxy-0007WX-Vf for bug-gnu-emacs@gnu.org; Tue, 08 Jul 2014 14:18:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4Zxq-0002aB-EH for bug-gnu-emacs@gnu.org; Tue, 08 Jul 2014 14:18:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4Zxq-0002a6-Ba for bug-gnu-emacs@gnu.org; Tue, 08 Jul 2014 14:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X4Zxp-0004wi-Qq for bug-gnu-emacs@gnu.org; Tue, 08 Jul 2014 14:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jul 2014 18:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17949-submit@debbugs.gnu.org id=B17949.140484347819002 (code B ref 17949); Tue, 08 Jul 2014 18:18:01 +0000 Original-Received: (at 17949) by debbugs.gnu.org; 8 Jul 2014 18:17:58 +0000 Original-Received: from localhost ([127.0.0.1]:47228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4Zxh-0004wM-JO for submit@debbugs.gnu.org; Tue, 08 Jul 2014 14:17:58 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22300) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X4Zxb-0004w0-4r for 17949@debbugs.gnu.org; Tue, 08 Jul 2014 14:17:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBah2BVIFbIQ X-IPAS-Result: ArUGAIDvNVNLd+D9/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBah2BVIFbIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="76890697" Original-Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Jul 2014 14:17:41 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 2FA5A60337; Tue, 8 Jul 2014 14:17:41 -0400 (EDT) In-Reply-To: <878uo7pl0x.fsf@naesten.mooo.com> (Samuel Bronson's message of "Sat, 05 Jul 2014 17:12:46 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) 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:91316 Archived-At: > Sometimes, I want to use .dir-locals.el to set a variable to refer to a > specific file within the tree in question, independantly of how deep in > that tree the file in question actually is. You could use something like: (eval (setq-local my-var (expand-file-name "etc/foo" (locate-dominating-file default-directory ".dir-locals.el")))) > Perhaps using a form something like: > ,(expand-file-name "etc/foo.bar" dir-locals-directory) Problem is security: the .dir-local.el file might not be under your control, so we don't want to run arbitrary code. The "eval" option above of course suffers from the same problem, but at least it's the official existing way to run arbitrary code, which means it doesn't run that code silently unless you've previous accepted it as "safe". This said, it might indeed be handy to be able to use , like you suggest (tho it too would need to go though some "security check", of course). Stefan