On 15/01/2023 16:01, Eli Zaretskii wrote:
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.
If we*are* going to do this (make all ts mode strictly optional), I
don't think either of this is a good idea: for a given foo-ts-mode, the
user might already have an auto-mode-alist entry configured with another
mode (third-party or not), and they will likely 'M-x foo-ts-mode' to try
how well it works (or doesn't).
Having auto-mode-alist modified automatically can come as a surprise
either way.
Note the this is different to having the auto-mode-alist entries set up
from the outset, because the user's alterations override those.
We can drop the auto-mode-alist alterations from ts modes altogether, to
bring them back when we do decide to enable them by default.