all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 40573@debbugs.gnu.org, Juri Linkov <juri@linkov.net>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#40573: 27.0.90; flymake-mode broken in scratch buffer
Date: Tue, 14 Apr 2020 09:48:43 +0100	[thread overview]
Message-ID: <CALDnm53MgxDu7px+K2AYaa-rappbfe7zkV3=-Tu0S0YS_szbBA@mail.gmail.com> (raw)
In-Reply-To: <83h7xmipi7.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3659 bytes --]

On Tue, Apr 14, 2020 at 6:51 AM Eli Zaretskii <eliz@gnu.org> 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ão Távora

[-- Attachment #2: Type: text/html, Size: 4136 bytes --]

  reply	other threads:[~2020-04-14  8:48 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 13:18 bug#40573: 27.0.90; flymake-mode broken in scratch buffer João Távora
2020-04-12 13:48 ` Eli Zaretskii
2020-04-12 14:24   ` João Távora
2020-04-12 14:44     ` Eli Zaretskii
2020-04-12 17:02       ` João Távora
2020-04-12 17:17         ` Eli Zaretskii
2020-04-12 17:50           ` João Távora
2020-04-12 23:58         ` Juri Linkov
2020-04-13  4:36           ` Eli Zaretskii
2020-04-13 23:17             ` Juri Linkov
2020-04-14  5:51               ` Eli Zaretskii
2020-04-14  8:48                 ` João Távora [this message]
2020-04-14 11:29                   ` Eli Zaretskii
2020-04-14 11:48                     ` João Távora
2020-04-14 12:38                       ` Eli Zaretskii
2020-04-14 12:56                         ` João Távora
2020-04-14 15:42                           ` Eli Zaretskii
2020-04-14 16:42                             ` João Távora
2020-04-14 20:05                               ` Stefan Monnier
2020-04-16 21:43                 ` Juri Linkov
2020-04-16 23:06                   ` Stefan Monnier
2020-04-17  6:49                     ` Eli Zaretskii
2020-04-17 10:07                       ` João Távora
2020-04-17 10:12                         ` Eli Zaretskii
2020-04-17 10:21                           ` João Távora
2020-04-17 11:49                             ` Eli Zaretskii
2020-04-17 11:57                               ` João Távora
2020-04-17 13:05                                 ` Eli Zaretskii
2020-04-17 15:20                                   ` João Távora
2020-04-17 15:28                                     ` Eli Zaretskii
2020-04-17 15:35                                       ` João Távora
2020-04-17 15:46                                         ` Eli Zaretskii
2020-04-17 15:55                                           ` João Távora
2020-04-17 17:19                                             ` Eli Zaretskii
2020-04-18  8:26                                               ` João Távora
2020-04-18  9:28                                                 ` Eli Zaretskii
2020-04-18 10:03                                                   ` João Távora
2020-04-18 11:08                                                     ` Eli Zaretskii
2020-04-18 11:57                                                       ` João Távora
2020-04-18 12:35                                                         ` Eli Zaretskii
2020-04-18 15:10                                                           ` João Távora
2020-04-18 23:36                                                             ` João Távora
2020-04-19  0:05                                                               ` Dmitry Gutov
2020-04-19  9:25                                                                 ` João Távora
2020-04-19 13:57                                                                   ` Dmitry Gutov
2020-04-19 16:31                                                                     ` João Távora
2020-04-19 16:38                                                                       ` Dmitry Gutov
2020-04-19  2:44                                                               ` Stefan Monnier
2020-04-19 14:01                                                               ` Eli Zaretskii
2020-04-19 20:17                                                                 ` João Távora
2020-04-20 13:41                                                                   ` Eli Zaretskii
2020-04-20 14:02                                                                     ` João Távora
2020-04-20 16:05                                                                       ` Eli Zaretskii
2020-05-01 11:10                                                                         ` João Távora
2020-04-18 11:55                                                     ` Basil L. Contovounesios
2020-04-18 12:03                                                       ` João Távora
2020-04-19  0:20                                                         ` Basil L. Contovounesios
2020-04-19 11:41                                                           ` João Távora
2020-04-18 23:42                                                 ` Juri Linkov
2020-04-19  9:16                                                   ` João Távora
2020-04-17 14:44                               ` Basil L. Contovounesios
2020-04-17 16:04                                 ` Stefan Monnier
2020-04-17  6:23                   ` Eli Zaretskii
2020-04-18 23:36                     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDnm53MgxDu7px+K2AYaa-rappbfe7zkV3=-Tu0S0YS_szbBA@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=40573@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.