emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make all tree-sitter modes optional


From: Dmitry Gutov
Subject: Re: Make all tree-sitter modes optional
Date: Tue, 17 Jan 2023 20:49:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 17/01/2023 20:40, Eli Zaretskii wrote:
Date: Tue, 17 Jan 2023 20:21:18 +0200
Cc: casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org,
  theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org
From: Dmitry Gutov <dgutov@yandex.ru>

+The new modes based on tree-sitter are for now entirely optional, and
+you must turn them on manually, or load them in your init file, or
+customize 'auto-mode-alist' to turn them on automatically for certain
+files.

I thought there would be something more in the docs, given that the new
behavior is unusual.

What do you suggest to add?

The design doesn't really make sense to me, so it would be hard for me to explain it to a user. So no proposed docs from me, sorry.

But I see you are referring to auto-mode-alist here, modifying which
will still be necessary for js-ts-mode and python-ts-mode. Which will
touch a lot of users, possibly even the majority of tree-sitter
enthusiasts, given that JS and Python are some of the most popular
languages these days.

And yet you rejected my counter-proposal claiming (if I got your
position right) that modying auto-mode-alist is difficult/annoying/etc
for an average user. To quote:

        - Customizing auto-mode-alist is not the easiest task, it
          requires good knowledge of Emacs regexps and alists.  So
          asking anyone who wants to try using the tree-sitter modes to
          do that is not the best idea from the POV of user-friendliness.

So which is it?

Both.  I mention auto-mode-alist as the last alternative, for those
who are fine with going that way.  It isn't black-and-white.

But it's either that, or "turn them on manually", right? That would also work with my proposal.

To "try out" tree-sitter modes, the users can 'M-x js-ts-mode' or etc
either way. But to switch to the said mode, they will need to deal with
auto-mode-alist, again, without any alternative.

That's specific to js-ts-mode (and one other, I think) because they
share the .el file with a non-tree-sitter mode.  If there's a
reasonable way to give them separate files, things would be easier.

Right. If they were in separate files, then we could write the doc with suggestions to merely violate the standard recommendation of avoiding 'require' in the init script.

But this is not a documentation issue, first and foremost.

Inconsistencies in design often turn up as documentation issues later.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]