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: Po Lu
Subject: Re: Make all tree-sitter modes optional
Date: Mon, 16 Jan 2023 09:12:23 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> So here's a suggestion for such a solution: we make all the
>> *-ts-mode's optional.  That is, we don't add any of them to
>> auto-mode-alist unless the file *-ts-mode.el is loaded, and we
>> document them all in NEWS and the user manual as optional.  users who
>> want them will have to manually activate them.  This way, the original
>> use case that started this bug report is automatically solved, and the
>> other use case, where the user intends to activate one of these modes,
>> is also served by showing the warning, which in that case is perfectly
>> justified: the user asked for something that we cannot do, so we warn
>> him/her.
>> 
>> This is a retreat of sorts, but I think it strikes a better balance
>> wrt user expectations, assuming not everyone will build with
>> tree-sitter.
>
> The proposed change to the current emacs-29 branch is below.  You will
> see that where possible, just loading a TS mode modifies
> auto-mode-alist if the tree-sitter support for that mode is available,
> whereas for other modes auto-mode-alist is modified only when the mode
> is actually turned on successfully for the first time.  This is
> because some of the TS modes have their own *.el files, whereas others
> share a .el file with other modes, and so loading that file doesn't
> necessarily means the user wants to use the tree-sitter based mode.
>
> With these changes, users are supposed to turn the mode manually when
> they want to use it, or customize auto-mode-alist in their init files
> to turn those modes automatically for certain files.  Modes that have
> their own *.el files can be just 'require'd in the init file to modify
> auto-mode-alist.
>
> This arrangement is perhaps not ideal, but I think it is safe enough
> and simple enough to go into Emacs 29.
>
> Comments? objections? ideas for improvements?  I will install in a few
> days, barring any serious problems.

Thank you.  I think this is a very reasonable arragement, certainly
better than what we had before.


reply via email to

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