unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca,
	larsi@gnus.org, theo@thornhill.no, jostein@secure.kjonigsen.net,
	emacs-devel@gnu.org
Subject: Re: Make all tree-sitter modes optional
Date: Wed, 15 Feb 2023 17:35:16 +0200	[thread overview]
Message-ID: <838rgzaqmj.fsf@gnu.org> (raw)
In-Reply-To: <Y+v24asr25nc9F4n@ACM> (message from Alan Mackenzie on Tue, 14 Feb 2023 21:02:25 +0000)

> Date: Tue, 14 Feb 2023 21:02:25 +0000
> Cc: juri@linkov.net, casouri@gmail.com, monnier@iro.umontreal.ca,
>   larsi@gnus.org, theo@thornhill.no, jostein@secure.kjonigsen.net,
>   emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > I'm okay with adding the latter, if it turns out easy enough and safe
> > enough (of which I'm not sure at all), and if such a command will be
> > implemented for all the *-ts-modes which have non-ts siblings, but I
> > see no reason for the former, since there are several simple ways to
> > cause the same effect, and they are all documented in NEWS.
> 
> OK, Try this (so far only on c-ts-mode.):
> 
> 
> diff --git a/etc/NEWS b/etc/NEWS
> index 2d15e39036a..0a745d7cde9 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -3239,10 +3239,13 @@ for which a "built-in" mode would be turned on.  For example:
>  
>      (add-to-list 'major-mode-remap-alist '(ruby-mode . ruby-ts-mode))
>  
> -If you try these modes and don't like them, you can go back to the
> -"built-in" modes by restarting Emacs.  But please tell us why you
> -didn't like the tree-sitter based modes, so that we could try
> -improving them.
> +Normally, the loading of one of the new modes amends 'auto-mode-alist'
> +such that future visiting of the same type of file will continue to
> +use that new mode.  If this is not what you want, do M-x
> +<mode>-make-ts-undefault-mode.  For a more permanent effect, put, for
> +example, the following into your initialization file:
> +
> +    (eval-after-load 'c-ts-mode '(c-make-ts-undefault-mode))

Please don't delete the text in NEWS, it is a result of many
discussions and a lot of thought.  Your proposal is yet another way of
going back to the non-ts modes, so simply _adding_ that to what's
already in NEWS should be much better.

> +(defun c-make-ts-undefault-mode ()
> +  "Make the older C and C++ Modes the default major modes for C(++) files."
> +  (interactive)
> +  (setq auto-mode-alist (delete '("\\.h\\'" . c-or-c++-ts-mode)
> +                                auto-mode-alist))
> +  (setq auto-mode-alist
> +        (delete '("\\(\\.[chi]\\|\\.lex\\|\\.y\\(acc\\)?\\|\\.x[bp]m\\)\\'" . c-ts-mode)
> +		auto-mode-alist))
> +  (setq auto-mode-alist
> +        (delete
> +	 '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'"
> +	   . c++-ts-mode)
> +	 auto-mode-alist)))
> +

So you revert auto-mode-alist to its original shape, but leave the
buffers already under c-ts-mode in that mode?  Is that what the users
would expect, you think?

Also, this won't work if the user customized auto-mode-alist in some
way wrt some of those file-name extensions.

> > Then they [proposed amendments] aren't "reasonable" at this time.
> > Maybe later, maybe on master.
> 
> That will be too late, the damage will have been done.

What "damage"? why do you call "damage" changes made by others in
Emacs as part of Emacs development?

> It is the first experience people have of the new modes which will
> create their long term impressions of them.

Please leave that to people.  We are introducing new technology to
Emacs, and try doing that in the least intrusive way.  If you don't
want to help that effort (a stance that is frankly very
disappointing), at least don't bad-mouth it.

> I remember something similar happening in Emacs 21.1, when the new
> fringes were not made optional.  Lots of users complained loudly and
> bitterly.

Well, that's exactly why these new modes are entirely optional.

> > As I said several times, we have no good idea yet how users will react
> > to what we have.  Maybe, after we hear from them, we decide to
> > implement such switches, who knows.
> 
> We are ourselves all users, too.  We know how we have reacted, and it is
> reasonable to try to prevent bad experiences for users similar to
> ourselves.

For you and me as users, having to restart Emacs, or having to use a
separate session for such experiments, is an entirely reasonable and
simple alternative, one which should eliminate any need for undoing
the "damage" of c-ts-mode.



  reply	other threads:[~2023-02-15 15:35 UTC|newest]

Thread overview: 119+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <84973.1672843723@hassadar.pretzelnet.org>
     [not found] ` <83wn62xi3k.fsf@gnu.org>
     [not found]   ` <m1cz7u5brr.fsf@yahoo.es>
     [not found]     ` <83o7rexe2n.fsf@gnu.org>
     [not found]       ` <83h6x5xym7.fsf@gnu.org>
2023-01-15 14:01         ` Make all tree-sitter modes optional Eli Zaretskii
2023-01-15 23:39           ` Dmitry Gutov
2023-01-16  7:43             ` Theodor Thornhill
2023-01-16 16:30               ` Dmitry Gutov
2023-01-16 12:34             ` Eli Zaretskii
2023-01-16 13:06               ` Dmitry Gutov
2023-01-16 14:20                 ` Eli Zaretskii
2023-01-16 14:50                   ` Dmitry Gutov
2023-01-16 14:59                     ` Eli Zaretskii
2023-01-17 12:59                       ` Dmitry Gutov
2023-01-17 13:47                         ` Eli Zaretskii
2023-01-17 14:32                           ` Dmitry Gutov
2023-01-17 14:52                             ` Eli Zaretskii
2023-01-17 15:22                               ` Dmitry Gutov
2023-01-17 17:02                                 ` Eli Zaretskii
2023-01-17 17:10                                   ` Dmitry Gutov
2023-01-17 17:38                                     ` Eli Zaretskii
2023-01-17 17:59                                       ` Dmitry Gutov
2023-01-17 18:04                                         ` Eli Zaretskii
2023-01-17 18:21                                           ` Dmitry Gutov
2023-01-17 18:40                                             ` Eli Zaretskii
2023-01-17 18:49                                               ` Dmitry Gutov
2023-01-17 19:03                                                 ` Eli Zaretskii
2023-01-17 19:21                                                   ` Dmitry Gutov
2023-01-18  1:11                                                     ` Yuan Fu
2023-01-18  1:23                                                       ` Dmitry Gutov
2023-01-18  3:34                                                         ` Eli Zaretskii
2023-01-18  3:52                                                           ` Dmitry Gutov
2023-01-18 12:06                                                             ` Eli Zaretskii
2023-01-18 14:00                                                               ` Dmitry Gutov
2023-01-18 14:51                                                                 ` Eli Zaretskii
2023-01-18 12:36                                                           ` Stefan Monnier
2023-01-17 17:34                             ` treesit-forward-sexp (was: Make all tree-sitter modes optional) Juri Linkov
2023-01-17 17:40                               ` Theodor Thornhill
2023-01-17 18:17                                 ` treesit-forward-sexp Juri Linkov
2023-01-17 17:50                               ` treesit-forward-sexp (was: Make all tree-sitter modes optional) Dmitry Gutov
2023-01-17 17:59                               ` Eli Zaretskii
2023-01-16  1:12           ` Make all tree-sitter modes optional Po Lu
2023-01-17 17:30           ` Juri Linkov
2023-01-17 17:58             ` Eli Zaretskii
2023-01-17 18:19               ` Juri Linkov
2023-01-17 18:41                 ` Eli Zaretskii
2023-02-14 19:08               ` Alan Mackenzie
2023-02-14 19:29                 ` Eli Zaretskii
2023-02-14 21:02                   ` Alan Mackenzie
2023-02-15 15:35                     ` Eli Zaretskii [this message]
2023-02-15 17:57                       ` Alan Mackenzie
2023-02-15 18:33                         ` Eli Zaretskii
2023-02-15 20:31                           ` Alan Mackenzie
2023-02-16  5:41                             ` tomas
2023-02-16  7:27                             ` Eli Zaretskii
2023-02-16 22:05                               ` Yuan Fu
     [not found]                           ` <87v8k2g04m.fsf@dick>
2023-02-15 20:34                             ` Eli Zaretskii
     [not found]                               ` <87mt5eegkw.fsf@dick>
2023-02-16  7:53                                 ` Eli Zaretskii
2023-02-16  8:52                                   ` Po Lu
2023-02-15 21:40                           ` Alan Mackenzie
2023-02-17 13:30                           ` Alan Mackenzie
2023-02-17 13:37                             ` Po Lu
2023-02-17 13:46                               ` Stefan Monnier
2023-02-17 14:16                                 ` Po Lu
2023-02-17 14:40                                   ` Eli Zaretskii
2023-02-17 14:56                                     ` Dmitry Gutov
2023-02-17 15:04                                       ` Eli Zaretskii
     [not found]                                         ` <8735741fic.fsf@dick>
2023-02-17 15:41                                           ` Alan Mackenzie
2023-02-17 16:04                                       ` Make all tree-sitter modes optional Stefan Kangas
2023-02-17 17:42                                         ` Morgan Willcock
2023-02-17 15:15                                     ` Gregory Heytings
2023-02-17 13:54                               ` Alan Mackenzie
     [not found]                               ` <d4c1a7f6-b5bf-f4f3-8d79-1c6b1d07cf70@yandex.ru>
2023-02-17 14:22                                 ` Po Lu
2023-02-17 14:58                             ` Eli Zaretskii
2023-02-17 15:18                               ` Alan Mackenzie
2023-02-15 18:34                         ` Stefan Monnier
2023-02-15 19:01                           ` Dmitry Gutov
2023-02-15 19:26                             ` Stefan Monnier
2023-02-15 19:47                               ` Eli Zaretskii
2023-02-15 19:53                                 ` Stefan Monnier
2023-02-15 20:06                                   ` Eli Zaretskii
2023-02-15 21:04                                     ` Stefan Monnier
2023-02-16  7:42                                       ` Eli Zaretskii
2023-02-16  9:49                                         ` Basil L. Contovounesios
2023-02-16 11:48                                           ` Eli Zaretskii
2023-02-16 14:41                                         ` Stefan Monnier
2023-02-16 15:42                                           ` Eli Zaretskii
2023-02-16 16:45                                             ` Stefan Monnier
2023-02-16 17:05                                               ` Eli Zaretskii
2023-02-16 19:14                                                 ` Dmitry Gutov
2023-02-16 20:07                                                 ` Stefan Monnier
2023-02-16  5:45                                     ` tomas
2023-02-16  8:26                                       ` Eli Zaretskii
2023-02-16 10:30                                         ` Alan Mackenzie
2023-02-16 12:38                                           ` Po Lu
2023-02-16 12:53                                             ` Dmitry Gutov
2023-02-15 20:24                               ` Dmitry Gutov
2023-02-16  7:05                                 ` Eli Zaretskii
2023-02-16  7:53                                   ` Theodor Thornhill
2023-02-16  8:34                                     ` Eli Zaretskii
2023-02-16  8:46                                       ` Theodor Thornhill
2023-02-16 11:58                                       ` Dmitry Gutov
2023-02-16 11:56                                     ` Dmitry Gutov
2023-02-16 14:48                                       ` Theodor Thornhill via Emacs development discussions.
2023-02-16 14:56                                         ` Dmitry Gutov
2023-02-16 15:15                                           ` Theodor Thornhill
2023-02-15 23:48                               ` Lynn Winebarger
2023-02-16  2:56                                 ` Stefan Monnier
2023-02-15 19:07                           ` Eli Zaretskii
2023-02-15 19:27                             ` Stefan Monnier
2023-02-15 21:06                             ` Basil L. Contovounesios
2023-02-16  7:44                               ` Eli Zaretskii
2023-02-15 18:25                 ` Juri Linkov
2023-01-19 16:53 Pedro Andres Aranda Gutierrez
2023-01-20  8:30 ` Eli Zaretskii
2023-01-20 16:31   ` Pedro Andres Aranda Gutierrez
2023-01-20 19:13     ` Eli Zaretskii
2023-01-21 11:30       ` Pedro Andres Aranda Gutierrez
2023-01-21 11:48         ` Eli Zaretskii
2023-01-22  6:23           ` Pedro Andres Aranda Gutierrez
2023-01-22  6:38             ` Eli Zaretskii
2023-01-22 10:46               ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2023-02-18  7:55 Pedro Andres Aranda Gutierrez
2023-03-11 12:45 ` Ongaro

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=838rgzaqmj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=acm@muc.de \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=jostein@secure.kjonigsen.net \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).