all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 58506@debbugs.gnu.org, Robert Pluim <rpluim@gmail.com>,
	Stefan Kangas <stefan@marxist.se>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Juri Linkov <juri@linkov.net>
Subject: bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist
Date: Sun, 16 Oct 2022 09:34:48 +0000	[thread overview]
Message-ID: <87czas5cxz.fsf@posteo.net> (raw)
In-Reply-To: <875ygk2lzz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 10:47:28 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> As Philip points out, "hard to write" is circumvented by
>> `add-dir-local-variable`.
>
> My ever-reliable statistics team is informing me that 99.74% of
> .dir-locals files are written by hand.

Really?  I guess by virtue of participating in this very discussion I'm
not the average Emacs user, but I'd be surprised if
`add-dir-local-variable' is that unknown.

>> We should either make it use a proper subset of ELisp, or make it use
>> a syntax that's sufficiently different.
>>
>> Maybe something like:
>>
>>     (c-mode
>>      (:set c-file-style "GNU")
>>      (:set treesit-thing t)
>>      (:set odd-list (cons 3 odd-list))
>>      (:minor-mode indent-tabs-mode -1) ;; Disable
>>      (:minor-mode blink-parentheses-mode))

And I assume that if you don't wrap the block in a (foo-mode ...)
construct, that the settings will apply to all modes, right?

> Yes, that's much better than my initial suggestion.  But I like the
> safe-lisp approach better.

... why not both?  I can imagine that safe-lisp will take a while before
it becomes usable, just because something like `safe-eval-p' has to be
quite exhaustive, and at the very least handle all special forms.  Elisp
isn't a Scheme so that means that a number of methods have to be
implemented...

Meanwhile .dir-locals.eld with Stefan's syntax seems like a good
improvement over the current syntax -- especially if you are right about
how many people write these files from hand.

>> [ I dropped the "set-early" because I still haven't heard any good
>>   reason why we'd need that nor what that would really mean (e.g. how it
>>   could be implemented).  ]
>
> Some major modes react to variables to change how they work.  So
> you'd say
>
> (setq org-thingamabob-syntax-version 2)
> (org-thingamabob-mode)
>
> And this has to be set before the mode is called, because the mode is
> very expensive and re-interpreting the file afterwards is ungood.
>
>>> `safep' would have to be a bit adjusted -- a `safep' for `odd-list'
>>> would be (cl-every #'oddp) etc.
>>
>> Sorry, I don't know what problem you're alluding to.
>> Why would `safep` need to be adjusted?
>
> It's not necessary, but it'd be nice to be able to say "this element is
> safe to add to the list" instead of saying "after adding this element to
> the list, the resulting list is safe".

I have seen a lot of packages that either forget or don't bother to
specify safe values even if they are applicable.  Making it easier to do
so could help motivate maintainers to specify these.





  reply	other threads:[~2022-10-16  9:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  9:05 bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled Philip Kaludercic
2022-10-13 14:20 ` Stefan Kangas
2022-10-13 14:32   ` Philip Kaludercic
2022-10-13 14:51     ` Stefan Kangas
2022-10-13 17:18   ` Juri Linkov
2022-10-13 19:11     ` Philip Kaludercic
2022-10-14  9:22     ` bug#58506: Use ".dir-locals.eld" and ".dir-locals-2.eld" when they exist Stefan Kangas
2022-10-14 10:38       ` Eli Zaretskii
2022-10-14 12:36         ` Stefan Kangas
2022-10-14 11:25       ` Lars Ingebrigtsen
2022-10-14 12:36         ` Stefan Kangas
2022-10-14 13:04         ` Robert Pluim
2022-10-14 13:10           ` Lars Ingebrigtsen
2022-10-14 13:23             ` Robert Pluim
2022-10-14 13:29               ` Lars Ingebrigtsen
2022-10-14 13:41                 ` Robert Pluim
2022-10-14 15:13           ` Philip Kaludercic
2022-10-15  9:18             ` Lars Ingebrigtsen
2022-10-15  9:38               ` Philip Kaludercic
2022-10-15  9:42                 ` Lars Ingebrigtsen
2022-10-15 10:00                   ` Lars Ingebrigtsen
2022-10-15 11:35                   ` Philip Kaludercic
2022-10-15 13:56                     ` Lars Ingebrigtsen
2022-10-15 15:12                       ` Philip Kaludercic
2022-10-15 16:22                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-16  8:39                         ` Lars Ingebrigtsen
2022-10-15 10:05                 ` Stefan Kangas
2022-10-15 15:19               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-16  8:47                 ` Lars Ingebrigtsen
2022-10-16  9:34                   ` Philip Kaludercic [this message]
2022-10-16  9:43                     ` Lars Ingebrigtsen
2022-10-16 13:38                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-16 13:44                     ` Lars Ingebrigtsen
2022-10-18 13:30                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-18  7:28                 ` Juri Linkov
2022-10-18 13:25                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-14 13:38         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-14 15:07       ` Philip Kaludercic
2022-10-14 16:32     ` bug#58486: [PATCH] Prevent .dir-locals.el from being byte-compiled Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-15 19:16       ` Juri Linkov
2022-10-16 13:17         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-13 18:02 ` Lars Ingebrigtsen
2022-10-14 18:14   ` Philip Kaludercic

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

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

  git send-email \
    --in-reply-to=87czas5cxz.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=58506@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rpluim@gmail.com \
    --cc=stefan@marxist.se \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.