[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add a separate mode for .dir-locals.el
From: |
Clément Pit-Claudel |
Subject: |
Re: Add a separate mode for .dir-locals.el |
Date: |
Sat, 19 Oct 2019 12:51:37 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 2019-10-19 10:14, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <address@hidden>
>> Date: Sat, 19 Oct 2019 08:53:23 -0400
>> Cc: address@hidden, address@hidden
>>
>> Yes, I can describe in more details. [...]
>
> Thanks, Clément, for your detailed description. It really makes the
> situation with Flymake crystal clear.
:)
>> My motivation for proposing a separate mode was that we already have a
>> mechanism (atuo-mode-alist) to attach specific behaviors to specific file
>> names, so it seemed natural to reuse that mechanism to run different code
>> for regular ELisp files and dir-locals files. IOW, I thought it was an
>> anti-pattern to do file-name checks in a major-mode definition.
>
> But this part only works for .dir-locals.el files, it will not work
> for any file named otherwise.
That's true. I didn't give these files much thought, because (since they don't
end in .el) they don't trigger emacs-lisp-mode, and so they are not a problem
for Flycheck.
> E.g., my saveplace file is called
> _places.sav (for boring historical reasons), and the only way of using
> such a new mode for it would be to manually turn it on when that file
> is visited.
That's true if we were to introduce a general mode for Lisp data (and, indeed I
haven't given such a mode much thought). If we introduced a mode specifically
designed for dir-locals files, on the other hand, it would be turned on
automatically for all relevant files (but I see why it's more attractive to
look for a solution more general than a dir-locals mode).
> I suggested to collect the traits common to these files, and then
> discuss what would be the appropriate mode for them. I don't think we
> have now a clear picture of what is or might be needed. In
> particular, I don't think we have enough data to decide whether
> elisp-mode should support such files as a built-in feature, or there's
> enough differences to justify a separate mode. In the latter case, we
> will have to devise some way of turning on that new mode automatically
> in most cases.
Understood. So, for now at least, I will push a patch to Flycheck along the
lines of the patch you suggested for Flymake.
Clément.
- Re: Add a separate mode for .dir-locals.el, (continued)
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Clément Pit-Claudel, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Clément Pit-Claudel, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/19
- Re: Add a separate mode for .dir-locals.el,
Clément Pit-Claudel <=
- Re: Add a separate mode for .dir-locals.el, Dmitry Gutov, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Alan Mackenzie, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Dmitry Gutov, 2019/10/19
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/20
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/20
- Re: Add a separate mode for .dir-locals.el, Juri Linkov, 2019/10/20
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/20
- Re: Add a separate mode for .dir-locals.el, Dmitry Gutov, 2019/10/21
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/21
- Re: Add a separate mode for .dir-locals.el, Dmitry Gutov, 2019/10/21