emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two problems with directory-local variables


From: Marcin Borkowski
Subject: Re: Two problems with directory-local variables
Date: Mon, 17 Sep 2018 17:45:31 +0200
User-agent: mu4e 1.1.0; emacs 27.0.50

On 2018-09-17, at 11:28, Phil Sainty <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]