[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add a separate mode for .dir-locals.el
From: |
Eli Zaretskii |
Subject: |
Re: Add a separate mode for .dir-locals.el |
Date: |
Thu, 17 Oct 2019 17:12:04 +0300 |
> From: João Távora <address@hidden>
> Date: Thu, 17 Oct 2019 14:59:34 +0100
>
> > Why is that a hack? Shouldn't Flymake "understand" the file it is
> > working on, including its syntax etc.?
>
> In fact, no. Not the new Flymake at least (and even in the old one I
> have my doubts). That is a job for mode-specific functions that hook
> onto Flymake's interfaces. They are known as Flymake backends and
> usually place themselves in the local value of the
> flymake-diagnostic-functions hook. For lisp/elisp-mode.el, there are
> two backends: elisp-flymake-byte-compile and elisp-flymake-checkdoc.
>
> Maybe I misunderstood your suggestion: if you meant changing _those_ two
> backends so that they notice they are in a dir-locals file and disable
> themselves, then it's less bad.
That could be an okay solution, I think.
> But I you'd probably be adding more
> complexity to progmodes/elisp-mode.el than you would (to the same file,
> I guess) by setting up a trivial derived dir-locals-mode.
OTOH, having a major mode just to pacify some minor mode sounds gross
to me. Especially, and here I agree with Andreas, as there's nothing
special in .dir-locals.el except that it always includes mostly data
(and even that is inaccurate, since it can call eval).
> BTW, and on a tangent, a derived dir-locals-mode isn't the
> bestoption. In OO, a derivation that _removes_functionality is a
> no-no,it breaks "is a".
So we agree on that.
- Re: Add a separate mode for .dir-locals.el, (continued)
- Re: Add a separate mode for .dir-locals.el, Eli Zaretskii, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, Alan Mackenzie, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, Stefan Monnier, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, Alan Mackenzie, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, Stefan Monnier, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/17
- Re: Add a separate mode for .dir-locals.el, Alan Mackenzie, 2019/10/17
- Message not available
- Re: Add a separate mode for .dir-locals.el,
Eli Zaretskii <=
- Re: Add a separate mode for .dir-locals.el, João Távora, 2019/10/17
Re: Add a separate mode for .dir-locals.el, Andreas Schwab, 2019/10/17
Re: Add a separate mode for .dir-locals.el, Stefan Monnier, 2019/10/17