emacs-devel
[Top][All Lists]
Advanced

[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.



reply via email to

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