From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Add a separate mode for .dir-locals.el Date: Thu, 17 Oct 2019 15:00:48 +0100 Message-ID: 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: multipart/alternative; boundary="000000000000aa025405951ba537" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="72181"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 17 17:04:04 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 1iL7Js-000Iep-EM for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 17:04:04 +0200 Original-Received: from localhost ([::1]:50252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL7Jq-0005q2-IC for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2019 11:04:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42141) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL6Kv-0003f7-Kb for emacs-devel@gnu.org; Thu, 17 Oct 2019 10:01:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL6Ku-0005QS-66 for emacs-devel@gnu.org; Thu, 17 Oct 2019 10:01:05 -0400 Original-Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:37684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL6Kq-0005Op-Jm; Thu, 17 Oct 2019 10:01:00 -0400 Original-Received: by mail-io1-xd2c.google.com with SMTP id b19so3133096iob.4; Thu, 17 Oct 2019 07:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1XnJ/YUN4L6U84mXAxJG2oqrm1yx0rM6rtmnv53Uwuk=; b=ilRzq6j0qMvWSwav7qEFemweWv2YoS7LJCR4xQ9JhghY7aRmD97qJBBYA9Ki7H/i7t XdlckWGZiDuibbLlX1f2B1yN+4pzwLq6E/PjsJnZGDemRT6ELcYgR7Oe+9aF2x/Caw/B 3l0qSA4/5gIUFzdE57ZP1IqOlZa4pf3ECwoHVSS/zmwyTxt1CIJB78ohAxS5Yxe5kdgB A8+yUWki8/sxe/DyY2Z19K7uhsrJaQSg60JdeWd8Bop+E6jT8mRCyVz7h8pivzPbn8Y8 LsGHSOB2esTRkfOynwQ5qpZ/hrHdCsHVC556vfOqOXQtkj/0a3VdIbzEsEM7HpZxvPDl rJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1XnJ/YUN4L6U84mXAxJG2oqrm1yx0rM6rtmnv53Uwuk=; b=KMTp451blU+OUmoguDEzJs6tjjejWhkQKz18rIrDEUf6jL5HTp/N2IMmiV1bkHBkjd qokrIAmDBv8f8j5CoOdelU0gw6glaP/sxS/zbY7xzzJwpAdGiHZIULoiJBixS+qmgqMr jbNEY19VTn+XOihR7sIglUdjsTVxXxblWjWcL2GQcc2U/fs3wsjLcmXyAcBZVsQ43wqZ +sEMHX+Pd2mRfeIUETkOmX6RYCcGaZvvqVoOvSAsG6aZLI5SV+ruEl2BZZBlFz0klzSm 88z8Fq/xcIgcZ+RaVgjJoZm39+auPyFCDXcGthKGBZlYDXjONeeVJGZwtUDUCDXo1bHV /LSg== X-Gm-Message-State: APjAAAXQAUbudGeoKbsGp2S7irdPxsxgjxkawdjNXtvB1mJtqobPJ3ue Y/eZMpbV5kP6YZY82p3aaxNRgCH+7BLWLqR0IDJhpzLx X-Google-Smtp-Source: APXvYqzKl1ibTZYXh1uPpPlC9rTRN4BUgX85VV1jg+2htgzzbybNcIeN0div98S6cPGiR8XG+ltRWw+MtTbsivbqA1A= X-Received: by 2002:a6b:4f03:: with SMTP id d3mr3107739iob.199.1571320859589; Thu, 17 Oct 2019 07:00:59 -0700 (PDT) In-Reply-To: <83ftjrbjhm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2c 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:241141 Archived-At: --000000000000aa025405951ba537 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [Sorry for the double mail, Eli] On Thu, Oct 17, 2019 at 2:16 PM Eli Zaretskii wrote: > > > From: Jo=C3=A3o T=C3=A1vora > > Date: Thu, 17 Oct 2019 13:21:37 +0100 > > Cc: emacs-devel@gnu.org > > > > I don't know who proposed it, or what it meant exactly, but solving thi= s > > in Flymake directly sounds like hack. > > 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. 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. And having a function that silently becomes a noop (the so-called "maybe" idiom) is slightly hacky IMO. But sometimes it's half-decent, I guess. Jo=C3=A3o 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". A better option would be to have a base `lisp-prog-mode` and hen derive emacs-lisp-mode from it. But that is maybe impractical for other reasons and not justified by this case. On Thu, Oct 17, 2019 at 2:16 PM Eli Zaretskii wrote: > > From: Jo=C3=A3o T=C3=A1vora > > Date: Thu, 17 Oct 2019 13:21:37 +0100 > > Cc: emacs-devel@gnu.org > > > > I don't know who proposed it, or what it meant exactly, but solving thi= s > > in Flymake directly sounds like hack. > > Why is that a hack? Shouldn't Flymake "understand" the file it is > working on, including its syntax etc.? > --=20 Jo=C3=A3o T=C3=A1vora --000000000000aa025405951ba537 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
[Sorry for the double mail, Eli]

On Thu, Oct 17, 2019 at 2:16 PM Eli Zarets= kii <eliz@gnu.org> wrote:
>=
> > From: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>
> > Date: Thu, 17 Oct 2019= 13:21:37 +0100
> > Cc: ema= cs-devel@gnu.org
> >
> > I don't know who propose= d it, or what it meant exactly, but solving this
> > in Flymake di= rectly sounds like hack.
>
> Why is that a hack?=C2=A0 Shouldn&= #39;t Flymake "understand" the file it is
> working on, inc= luding its syntax etc.?
=C2=A0
In fact, no.=C2=A0 Not the new Flymake= at least (and even in the old one I
have my doubts).=C2=A0 That is a jo= b for mode-specific functions that hook
onto Flymake's interfaces.= =C2=A0 They are known as Flymake backends and
usually place themselves i= n the local value of the
flymake-diagnostic-functions hook.=C2=A0 For li= sp/elisp-mode.el, there are
two backends: elisp-flymake-byte-compile and= elisp-flymake-checkdoc.

Maybe I misunderstood your suggestion: if y= ou meant changing _those_ two
backends so that they notice they are in a= dir-locals file and disable
themselves, then it's less bad.=C2=A0 B= ut I you'd probably be adding more
complexity to progmodes/elisp-mod= e.el than you would (to the same file,
I guess) by setting up a trivial = derived dir-locals-mode.=C2=A0 And having a
function that silently becom= es a noop (the so-called "maybe" idiom) is
slightly hacky IMO.= =C2=A0 But sometimes it's half-decent, I guess.

Jo=C3=A3o
BTW, and on a tangent, a derived dir-locals-mode isn't the
bestopti= on. In OO, a derivation that _removes_functionality is a
no-no,it breaks= "is a".=C2=A0 A better option would be to have a base
`lisp-p= rog-mode` and hen derive emacs-lisp-mode from it.=C2=A0 But that is
mayb= e impractical for other reasons and not justified by this case.

On Thu, Oct = 17, 2019 at 2:16 PM Eli Zaretskii <eliz@= gnu.org> wrote:
> From: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>
> Date: Thu, 17 Oct 2019 13:21:37 +0100
> Cc: emacs-dev= el@gnu.org
>
> I don't know who proposed it, or what it meant exactly, but solvin= g this
> in Flymake directly sounds like hack.

Why is that a hack?=C2=A0 Shouldn't Flymake "understand" the = file it is
working on, including its syntax etc.?


--
Jo=C3=A3o T=C3=A1vora
--000000000000aa025405951ba537--