[Top][All Lists]

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

Re: master 9ac6ff5: Make the test for auto-mode-alist from .dir-local.el

From: Lars Ingebrigtsen
Subject: Re: master 9ac6ff5: Make the test for auto-mode-alist from .dir-local.el stricter
Date: Sat, 24 Jul 2021 17:46:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> This may be too strict...  on the other hand, perhaps the check should
>> be even stricter -- perhaps a whitelist of allowed modes?  (Perhaps (by
>> default) populated from `auto-mode-alist'.)
> Could you clarify what is the purpose of this test?
> AFAICT the test that "corresponds" to what we do for file-local
> variables is just to check the `-mode` suffix (since we accept any
> `mode:foo` and call `foo-mode`).

Emacs queries you about stuff like "mode: tex-mode", though -- the
current .dir-locals.el thing does not, which makes it kinda
... dangerous...

> So if you think we should make it stricter for the dir-local
> auto-mode-alist, maybe we should also make it stricter for the
> file-local `mode:` thingy.

Or we could add querying to the new dir-local/auto-mode-alist thing to
bring some parity, but I think that could be annoying?  Or...  since the
queryer offers to store the answer, perhaps it won't be?

It's not immediately obvious to me what the right trade-offs between
security and usability is here.  I think that, basically, all our
built-in (non-special) modes are pretty much safe to use here.  (Or
perhaps all modes descended from text-mode and prog-mode?)  So I'd
prefer being able to use all those in this .dir-locals.el construct
without Emacs querying me about those...

Or something?  Anybody got any ideas?

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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