Subject: Re: bug#61177: 30.0.50; There should be an autoload cookie preceding (add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode))

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 Jan 2023 19:25:30 +0200

tags 61177 notabug wontfix
thanks

> Cc: [email-masked]
> From: Brian Leung <[email-masked]>
> Date: Mon, 30 Jan 2023 15:09:00 +0000
> 
> 
> When I open a yaml file from an "emacs -q" session, I would like to see
> it start up with yaml-ts-mode. However, since there is no autoload at
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/textmodes/yaml-ts-mode.el?h=c53952164fe54fee41343fd4008f610f7a284d26#n146,
> this does not occur, and the file instead starts up in fundamental-mode.
> 
> I think each such tree-sitter-mode auto-mode-alist adjustment should be
> preceded by an autoload cookie.

We deliberately decided not enable these modes by default, because
quite a few people still build Emacs without tree-sitter, and are
annoyed by warnings these modes emit when they discover that
tree-sitter is not available.  Other people are used to editing yaml
and other files in some other modes or in Fundamental, and don't want
Emacs to decide that for them.

So for now these modes are opt-in, and that's how it will stay until
we collect more user experience and until tree-sitter installation
will become much more widespread.  If you have tree-sitter installed,
and want yaml-ts-mode to be turned on automatically in buffers
visiting yaml files, you can have that via simple customizations in
your init file.