unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Two problems with directory-local variables
Date: Mon, 17 Sep 2018 17:45:31 +0200	[thread overview]
Message-ID: <87y3c0xh44.fsf@mbork.pl> (raw)
In-Reply-To: <1d2129643cecde529cb9b47e4e015c48@webmail.orcon.net.nz>


On 2018-09-17, at 11:28, Phil Sainty <psainty@orcon.net.nz> 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	other threads:[~2018-09-17 15:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17  8:08 Two problems with directory-local variables Marcin Borkowski
2018-09-17  9:28 ` Phil Sainty
2018-09-17 15:45   ` Marcin Borkowski [this message]
2018-09-17 23:15     ` Juri Linkov
2018-09-18  0:04       ` Phil Sainty
2018-09-18  0:19         ` Juri Linkov
2018-09-18  2:15           ` Stefan Monnier
2018-09-19 22:38             ` Juri Linkov
2018-09-20  1:42               ` Drew Adams
2018-09-20 20:59                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y3c0xh44.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=emacs-devel@gnu.org \
    --cc=psainty@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).