From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#40573: 27.0.90; flymake-mode broken in scratch buffer Date: Tue, 14 Apr 2020 09:48:43 +0100 Message-ID: References: <835ze4lsr1.fsf@gnu.org> <831roslq62.fsf@gnu.org> <87sgh89r78.fsf@mail.linkov.net> <83lfn0j92e.fsf@gnu.org> <87imi39e8w.fsf@mail.linkov.net> <83h7xmipi7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000009667a05a33c45d0" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1516"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40573@debbugs.gnu.org, Juri Linkov , Stefan Monnier , Dmitry Gutov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 14 10:50:18 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOHGr-0000IP-Cn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Apr 2020 10:50:17 +0200 Original-Received: from localhost ([::1]:54478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOHGq-000699-F0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Apr 2020 04:50:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOHGd-00060G-V7 for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2020 04:50:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOHGc-0003Kt-6s for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2020 04:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49905) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOHGc-0003Kp-4L for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2020 04:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jOHGc-0004FV-2S for bug-gnu-emacs@gnu.org; Tue, 14 Apr 2020 04:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Apr 2020 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40573 X-GNU-PR-Package: emacs Original-Received: via spool by 40573-submit@debbugs.gnu.org id=B40573.158685414516264 (code B ref 40573); Tue, 14 Apr 2020 08:50:02 +0000 Original-Received: (at 40573) by debbugs.gnu.org; 14 Apr 2020 08:49:05 +0000 Original-Received: from localhost ([127.0.0.1]:33218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jOHFg-0004EG-Kx for submit@debbugs.gnu.org; Tue, 14 Apr 2020 04:49:05 -0400 Original-Received: from mail-io1-f54.google.com ([209.85.166.54]:40151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jOHFd-0004Dk-BU for 40573@debbugs.gnu.org; Tue, 14 Apr 2020 04:49:02 -0400 Original-Received: by mail-io1-f54.google.com with SMTP id w1so12388403iot.7 for <40573@debbugs.gnu.org>; Tue, 14 Apr 2020 01:49:01 -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=q6wJaXdmT2OYM+9+YD4VmxzOdynPHbnONHPlWLFPsro=; b=p+f2fofC6IqwQUxA7onQluB7Mc/f7jDTmIgHFKgVusJeXwCztl+DXkbbp45GIzdq3x KWkpygJVqh5P6cp6GA4X2AUSMsAq42QecRgriaK1gArRzl7IMMG0VBBaHpVysjdVIWwW ezu+esQPNAesOmllbFpObaN2Fcf6Nk5oxBeAe7cIR1wPt6VAWx3RNlRjSDcYwOan7hWf vDwMJwCjlTQqlq5nYyNzEroh5KiLsb+IL1ouPSjBDcIGJP/WyEXyz25/RdG14Ey9KJRq BRHjLaW4gAI2l12azFzE8HwWtWXm4XXs7OMNS3W0LrSfLTLuGHthO79Hk2vaTgnhil9c Tavg== 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=q6wJaXdmT2OYM+9+YD4VmxzOdynPHbnONHPlWLFPsro=; b=kL2YFIfMC6Gshe2F9vEbg/D80bFqP8rp6AeoOlsdmPPBJzmlvQHHlmda7XQS8/9Mok 5Xe4GYbs0EjdEmIId9xy7SGzoh4E3UQP7eZ1xW+mVtp/LeyljOb86Zl1/c9tVFfjPwh3 trITHYbZJQ+4MrOz07vVqO8LSsbFuYUlJ+qOBv83rpa1pn+p5+Fb3n5SeJntbbpbpbVT eOtper5pTMMLxHLTMRflnSUc2D8Ie1G10pnfKKdpTPKYPd0sm2neXq9ZLcRiGEhgfrJJ 6rm7UIdtJgoBJbwVAe5FXN4ren2OBGQeinCadLS0f/qaR7YEK8IXZa6Acb2AByBeTaZg kcEA== X-Gm-Message-State: AGi0PuaZ3ufMLgl8NdEx8YW1bVgxsY3b586E6FTxrn6IzJ0ecRVwB4VA EJ8GIMJIToBWucbuoulsr/WvOGT9jN/mc5RSua8= X-Google-Smtp-Source: APiQypJ/DDV0dlN4HQ4YjLjbeKVF/xbwe6X3F/sjX6Ocu5IL1edamTOft079zNgVYqimn29HTM9ex5o2STgL/IH0gZs= X-Received: by 2002:a5d:8d89:: with SMTP id b9mr20665497ioj.156.1586854135161; Tue, 14 Apr 2020 01:48:55 -0700 (PDT) In-Reply-To: <83h7xmipi7.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178350 Archived-At: --00000000000009667a05a33c45d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 14, 2020 at 6:51 AM Eli Zaretskii wrote: > > There are many other examples of ELisp data files. One is already > > mentioned .dir-locals.el that needs editing features from > > emacs-lisp-mode (indentation, commenting, ...) as well, > > but doesn't need the dynamic/lexical distinction. > > How would you propose to identify these files for turning on this > special mode? They don't seem to have a clear-cut set of extensions > and/or file names. One thing I don't understand is why is this important at all. I normally work with the Common Lisp language. When using that language, ones uses COMMON-LISP:WRITE to record things persistently to files that can be COMMON-LISP:READ back. Being data files, these files are edited only sporadically by humans because they are really meant to be understood by programs executing on machines. But when you do open them manually, it is quite useful to automatically pair parenthesis, fill comment paragraphs, understand strings, have sexp indentation, etc etc. Currently these files opens in fundamental-mode which has a syntax table, and not much else. It doesn't recognize comments, font-lock or do any type of useful indentation. I personally start up emacs-lisp-mode for them, and live with the annoyance of bogus flymake, bogus eldoc, etc.. Common lispers are a minority, but people working with Clojure or Guile will probably experience the same. And of course people working with Emacs Lisp will do so to. And, by the way, if you're thinking that the new mode shouldn'tbe called "emacs-lisp-data-mode" at all, but just "lisp-data-mode", then I fully agree. But I'm not bothered much that 'emacs' is in there, either: it doesn't change how useful the mode is for me or anyone else using lisp data files. Anyway, the only thing that distinguishes these files from the rest of the world's files is the fact that their contents can be `read` or COMMON-LISP:READ or clojure.core/read. There are not a lot of "tell-tale signs". Even a syntactic error such as a misplaced parenthesis still doesn't remove the file from this class of files: we still want to use a lisp-data-mode to edit them (and possibly to fix that parenthesis). It's a very large class of files. I _don't_ expect Emacs to cleverly turn on this new mode for every memeber of this class. Though it would be nice for Emacs to do this for _some_ members, presumably the ones it is very sure about, such as dir-locals.el or recentf. But for all the others: 1. If Emacs produces them, then we can change Emacs it to add a mode cookie to the top or trailer of the file; auto-mode-alist to record that file; or do nothing. 2. If Emacs doesn't produce them, then users are responsible for them. We can recommend that they add a cookie or use auto-mode-alist or magic-mode-alist. Even if we chose to do nothing every time, we will have still greatly improved the situation. As to _how_ the new mode is to be implemented, you'll see it's a very simple change. Simpler than your dir-locals.el-specific fix and fixes a much wider array of situations. Stefan's patch is a good starting point: https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00736.html Even the documentation for this would be simple to write. > Thanks for the other details, I think this is very useful. Examples such as recentf, tramp, and ido files had already been given. Again please don't base any implementation on those "details": they are just an example. The universe of lisp data files is much greater than that. -- Jo=C3=A3o T=C3=A1vora --00000000000009667a05a33c45d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Apr 14, 2020 at 6:51 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > There= are many other examples of ELisp data files.=C2=A0 One is already
> = > mentioned .dir-locals.el that needs editing features from
> >= emacs-lisp-mode (indentation, commenting, ...) as well,
> > but d= oesn't need the dynamic/lexical distinction.
>
> How would = you propose to identify these files for turning on this
> special mod= e?=C2=A0 They don't seem to have a clear-cut set of extensions
> = and/or file names.

One thing I don't understand is why is this i= mportant at all.

I normally work with the Common Lisp language.=C2= =A0 When using that
language, ones uses COMMON-LISP:WRITE to record thin= gs persistently to
files that can be COMMON-LISP:READ back.=C2=A0 Being = data files, these files
are edited only sporadically by humans because t= hey are really meant to
be understood by programs executing on machines.= =C2=A0 But when you do open
them manually, it is quite useful to automat= ically pair parenthesis,
fill comment paragraphs, understand strings, ha= ve sexp indentation, etc
etc.=C2=A0 Currently these files opens in funda= mental-mode which has a syntax
table, and not much else.=C2=A0 It doesn&= #39;t recognize comments, font-lock or
do any type of useful indentation= .

I personally start up emacs-lisp-mode for them, and live with the<= br>annoyance of bogus flymake, bogus eldoc, etc..

Common lispers are= a minority, but people working with Clojure or Guile
will probably expe= rience the same.=C2=A0 And of course people working with
Emacs Lisp will= do so to.

And, by the way, if you're thinking that the new mode= shouldn'tbe called
"emacs-lisp-data-mode" at all, but jus= t "lisp-data-mode", then I fully
agree.=C2=A0 But I'm not = bothered much that 'emacs' is in there, either: it
doesn't c= hange how useful the mode is for me or anyone else using lisp
data files= .

Anyway, the only thing that distinguishes these files from the res= t of
the world's files is the fact that their contents can be `read`= or
COMMON-LISP:READ or clojure.core/read.=C2=A0 There are not a lot of<= br>"tell-tale signs".=C2=A0 Even a syntactic error such as a misp= laced
parenthesis still doesn't remove the file from this class of f= iles: we
still want to use a lisp-data-mode to edit them (and possibly t= o fix
that parenthesis).

It's a very large class of files.=C2= =A0 I _don't_ expect Emacs to cleverly
turn on this new mode for eve= ry memeber of this class.=C2=A0 Though it would
be nice for Emacs to do = this for _some_ members, presumably the ones it
is very sure about, such= as dir-locals.el or recentf.=C2=A0 But for all the
others:

1. If= Emacs produces them, then we can change Emacs it to add a mode
cookie t= o the top or trailer of the file; =C2=A0auto-mode-alist to
record that f= ile; or do nothing.

2. If Emacs doesn't produce them, then users= are responsible for them.
We can recommend that they add a cookie or us= e auto-mode-alist or
magic-mode-alist.

Even if we chose to do not= hing every time, we will have still greatly
improved the situation.
<= br>As to _how_ the new mode is to be implemented, you'll see it's a= very
simple change.=C2=A0 Simpler than your dir-locals.el-specific fix = and fixes a
much wider array of situations.

Stefan's patch is= a good starting point:

=C2=A0 https://lists.gnu.org/archive/h= tml/emacs-devel/2019-10/msg00736.html

Even the documentation for= this would be simple to write.

> Thanks for the other details, I= think this is very useful.

Examples such as recentf, tramp, and ido= files had already been given.
Again please don't base any implement= ation on those "details": they are
just an example.=C2=A0 The = universe of lisp data files is much greater than
that.

--
Jo= =C3=A3o T=C3=A1vora
--00000000000009667a05a33c45d0--