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: Sat, 19 Oct 2019 14:36:21 +0100 Message-ID: References: <2058328b-aee5-8cb1-2659-a793e1354517@mit.edu> <835zkndcz4.fsf@gnu.org> <83ftjrbjhm.fsf@gnu.org> <83ftjr9sx4.fsf@gnu.org> <83eezb9s5b.fsf@gnu.org> <83bluf9qgb.fsf@gnu.org> <835zkn9o01.fsf@gnu.org> <83lfti8ovn.fsf@gnu.org> <83d0eu8c80.fsf@gnu.org> <83lfth6p0y.fsf@gnu.org> <83h8456jaj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000fbf9d1059543894e" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112654"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , Stefan Monnier , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 19 15:37:11 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 1iLous-000TB9-16 for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 15:37:10 +0200 Original-Received: from localhost ([::1]:54924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLouq-00064z-U2 for ged-emacs-devel@m.gmane.org; Sat, 19 Oct 2019 09:37:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38451) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLouM-00064f-8G for emacs-devel@gnu.org; Sat, 19 Oct 2019 09:36:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLouK-0003Ww-VX for emacs-devel@gnu.org; Sat, 19 Oct 2019 09:36:38 -0400 Original-Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:38012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLouJ-0003Vz-4E; Sat, 19 Oct 2019 09:36:35 -0400 Original-Received: by mail-io1-xd33.google.com with SMTP id u8so10749530iom.5; Sat, 19 Oct 2019 06:36:35 -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=w41p9hwmfHbx1xeGsWNRpKIgyWg4P1/eoPXy+yrCA5Q=; b=NC41wCqWGidGvn+9UpVp8p+kSxCDJVRpLjSvB8/K56Ii63Qs3XcYeAzW+ohr5zLGt7 VWGOXe3PTzsj+fgSZgwtAcCD8Ye8giWJTOIIp5IgszFAbO3oGaEaOrMJawZ1elpcFNJ+ rBfCIa7l7BuvsM8Hgxic4g9zqy7E8oQ6ZXw4wS+2JXeVPY2fU+vffv2yIBLCJTdArJCP brZkEaZWJ9wnfbbiEsLXhXrQUqfW8C+hEeyd7d+zbok+x0N6ST5Cz9Di/Nrg6zP7Slxm jtRg0FZulEJ3AZC1yOQ4ZXYg8Dw9O70lo/Iz+OZMtQB6kpHfoT3HVyYHwKH9pbRmllzX t38Q== 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=w41p9hwmfHbx1xeGsWNRpKIgyWg4P1/eoPXy+yrCA5Q=; b=AtQm/QIP1qOtUBpzX1HAak10Kao1NYFx/cZCrXk6whU9F92koRMFZ6Rq9nUwi6SyLo SPJyCegK1N+G5MRlbKLfhdARkWtIjM13eZHLLRZGBcV8ZkYMmsvd12y1YPChYiol7Ygx l0sdzbmPmPV8F53U3PxeQKNdEIw8b+Crk29Acqg6d+jirMvrbgyPP7JM+NYRtSoNskll WZl1rWuYTVTJTDHn15dnf+/DTW5J09PMQNZdYQPsC9UQEeFZPDhdXB4ycjVbd4p/3E+k EjYW4fq+F72JA6G20tIAHVebSAXL3ODuxWiTdqgwfSZ28CsgLwDy83a323NoVOqT0Idy Y54g== X-Gm-Message-State: APjAAAUdYZ4RyXLhWSFCB7IKxYlV9sfGER0sOa1gCl4FtwAvbSRNmizx bax7uTlP/B7jYTpCldEeCRFvx/fSAOj2YOItObykLDjnmxo= X-Google-Smtp-Source: APXvYqwjHxhw8CjO0+UKA2eqHM6igZTWeT1dSSbLX1jAtN9P1plO6ajHmFaxrTqjUOvimZJibvKCnHAYWQ7taynMkis= X-Received: by 2002:a5e:db47:: with SMTP id r7mr13843895iop.9.1571492193891; Sat, 19 Oct 2019 06:36:33 -0700 (PDT) In-Reply-To: <83h8456jaj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d33 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:241230 Archived-At: --000000000000fbf9d1059543894e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Oct 19, 2019 at 12:56 PM Eli Zaretskii wrote: > I thought it was just a guess, and I wanted us to be sure. Are we > sure the problem is triggered by an attempt to invoke the byte > compiler on the file? It was a guess because another Flymake backend, such as checkdoc, could have been producing similar bogus data. I also didn't try Flycheck. Anyway the guess is confirmed for Flymake, though apparently for Flycheck the problem also extends to its checkdoc checker. Here, "checker" ~=3D=3D "backend" BTW. > > > Creating a major mode for this issue is like shooting sparrows with > > > cannons. Why not extend emacs-lisp-mode to DTRT with > > > data-that-doesn't-make-sense-as-code instead? > > That is _exactly_ what Cl=C3=A9ment proposed in his original patch. > My understanding is that Cl=C3=A9ment proposed a new major mode. Yes, he did. By "extension" (to a major mode) I understood "derivation", as in basic OO's "Dog extends Mammal extends Animal", so a new major mode. Now I see you didn't mean that. If you mean just putting if-guards in emacs-lisp-mode, then I would't call it an "extension", really. But never mind nomenclature, the point is that, it (1) doesn't avoid Cl=C3=A9ment's need to put the very same if-guards in his Flycheck code, (2) isn't reusable to work for other file types (3) just doesn't work for other stuff that people put in emacs-lisp-mode-hook, for which we have no possible way to if-guard against. It is an anti-pattern, precisely the one that simple inheritance is designed to avoid. Jo=C3=A3o --000000000000fbf9d1059543894e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Oct 19, 2019 at 12:56 PM Eli Zaretskii <eliz@gnu.org> wrote:

> I thought = it was just a guess, and I wanted us to be sure.=C2=A0 Are we
> sure = the problem is triggered by an attempt to invoke the byte
> compiler = on the file?

It was a guess because another Flymake backend, such as= checkdoc, could
have been producing similar bogus data.=C2=A0 I also di= dn't try Flycheck.
Anyway the guess is confirmed for Flymake, though= apparently for
Flycheck the problem also extends to its checkdoc checke= r.

Here, "checker" ~=3D=3D "backend" BTW.
> > > Creating a major mode for this issue is like shooting sparr= ows with
> > > cannons.=C2=A0 Why not extend emacs-lisp-mode to= DTRT with
> > > data-that-doesn't-make-sense-as-code inste= ad?
> > That is _exactly_ what Cl=C3=A9ment proposed in his origin= al patch.
> My understanding is that Cl=C3=A9ment proposed a new majo= r mode.

Yes, he did.=C2=A0 By "extension" (to a major mode= ) I understood
"derivation", as in basic OO's "Dog ex= tends Mammal extends Animal", so a
new major mode.=C2=A0 Now I see = you didn't mean that.

If you mean just putting if-guards in emac= s-lisp-mode, then I would't
call it an "extension", really= .=C2=A0 But never mind nomenclature, the point
is that, it (1) doesn'= ;t avoid Cl=C3=A9ment's need to put the very same
if-guards in his F= lycheck code, (2) isn't reusable to work for other
file types (3) ju= st doesn't work for other stuff that people put in
emacs-lisp-mode-h= ook, for which we have no possible way to if-guard
against.=C2=A0 It is = an anti-pattern, precisely the one that simple
inheritance is designed t= o avoid.

Jo=C3=A3o
--000000000000fbf9d1059543894e--