Subject: Re: bug#79180: 31.0.50; Customize-browse emits treesit warnings

From: Eli Zaretskii <[email-masked]>
Date: Wed, 06 Aug 2025 15:26:21 +0300

merge 79180 64487
thanks

> From: Sean Devlin <[email-masked]>
> Date: Tue, 5 Aug 2025 15:18:10 -0500
> 
> Browsing the customization settings can raise warnings for tree-sitter
> modes that are not in use.
> 
> Recipe:
> 
> 0. Build Emacs with tree-sitter support, but don't install associated
> language grammars
> 1. Emacs -Q
> 2. M-x customize-browse
> 3. Expand the "Programming" group
> 4. Expand the "Languages" group
> 
> You will see a warning for any installed tree-sitter modes whose
> grammars are not installed. Emacs ships with several such modes,
> e.g. ruby-ts-mode, elixir-ts-mode, heex-ts-mode, php-ts-mode, and
> lua-ts-mode.
> 
> The warnings are surprising, since I'm just browsing customization
> settings, and not even settings specific to those modes. I haven't tried
> to enable any of these modes so far.
> 
> I think most users will not preemptively install language grammars for
> every installed tree-sitter mode (especially as more such modes are
> added), so browsing customization settings should not raise warnings
> like this.
> 
> Should these libraries really make noise like this when they are
> unintentionally loaded by the user?

This is a known issue, see bug#64487.  It's a side effect of the
decision to warn users when they activate tree-sitter based modes for
which they don't have a grammar library installed.  These warnings are
triggered by Custom which loads all the packages belonging to a
customization group when you browse that group.

The warning is harmless, and we don't have a good solution that would
avoid it in Customize but still emit it when the mode is loaded in
other ways.  Ideas for how to pull that trick will be welcome.  (The
fact that Custom loads the packages is a known misfeature.)