From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Add a separate mode for .dir-locals.el Date: Thu, 17 Oct 2019 17:12:04 +0300 Message-ID: <835zknbgwb.fsf@gnu.org> References: <2058328b-aee5-8cb1-2659-a793e1354517@mit.edu> <87wod4m7sr.fsf@gnus.org> <835zkndcz4.fsf@gnu.org> <83ftjrbjhm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="229814"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 17 16:44:58 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iL71L-000xZp-7j for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 16:44:55 +0200 Original-Received: from localhost ([::1]:49638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL71J-0006qB-Jd for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 10:44:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43875) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL6Vo-0008AI-Jm for emacs-devel@gnu.org; Thu, 17 Oct 2019 10:12:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iL6Vo-0000A2-Da; Thu, 17 Oct 2019 10:12:20 -0400 Original-Received: from [176.228.60.248] (port=3633 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iL6Vn-0007Le-8H; Thu, 17 Oct 2019 10:12:19 -0400 In-reply-to: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Thu, 17 Oct 2019 14:59:34 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241137 Archived-At: > From: João Távora > 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.