From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel Subject: Re: Two problems with directory-local variables Date: Mon, 17 Sep 2018 17:45:31 +0200 Message-ID: <87y3c0xh44.fsf@mbork.pl> References: <87a7ogzgul.fsf@mbork.pl> <1d2129643cecde529cb9b47e4e015c48@webmail.orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537199127 18400 195.159.176.226 (17 Sep 2018 15:45:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Sep 2018 15:45:27 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: emacs-devel To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 17 17:45:23 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1viF-0004dp-Jo for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2018 17:45:23 +0200 Original-Received: from localhost ([::1]:36191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1vkM-0000Gd-3M for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2018 11:47:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1vjd-0000Fi-3x for emacs-devel@gnu.org; Mon, 17 Sep 2018 11:46:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1vjX-0006mb-Dl for emacs-devel@gnu.org; Mon, 17 Sep 2018 11:46:49 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:60818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1vjX-0006ls-5U for emacs-devel@gnu.org; Mon, 17 Sep 2018 11:46:43 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B953BE6553; Mon, 17 Sep 2018 17:46:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nRjNefNeDSAS; Mon, 17 Sep 2018 17:46:38 +0200 (CEST) Original-Received: from localhost (apn-37-7-221-144.dynamic.gprs.plus.pl [37.7.221.144]) by mail.mojserwer.eu (Postfix) with ESMTPSA id E1EF9E62C0; Mon, 17 Sep 2018 17:46:37 +0200 (CEST) In-reply-to: <1d2129643cecde529cb9b47e4e015c48@webmail.orcon.net.nz> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.110.48.8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229900 Archived-At: On 2018-09-17, at 11:28, Phil Sainty wrote: > On 2018-09-17 20:08, Marcin Borkowski wrote: >> but this entry in .dir-locals.el does not work: >> ((nil . ((eval '(message "hello"))))) > > That is because the syntax is incorrect. You want: > > ((nil . ((eval . (message "hello"))))) > > or equivalently, without dotted pair syntax in the eval: > > ((nil . ((eval message "hello")))) Thanks! Actually, this is what `add-dir-local-variable' puts in .dir-locals.el, which looks a bit weird. It seems that I forgot about the dotted pairs, and "corrected" it to the wrong form. Thanks a lot! I'll update my blog post soon. > Note that your version was equivalent to evaluating: > > ('(message "hello")) That explains (at least partially) the weird error message I got ("(invalid-function (message hello))"). >> When I type this in .dir-locals.el: >> ((nil . ((eval (lambda () (message "hello")))))) >> it works as expected. > > Indeed, as that's evaluating this form: > > ((lambda () (message "hello"))) > > Although I wouldn't recommend that over the former > syntax. Do I get it correctly that this a Scheme-ish syntax with the lambda expression in place of the function name? Thanks a lot, -- Marcin Borkowski http://mbork.pl