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

From: Sean Devlin <[email-masked]>
Date: Tue, 5 Aug 2025 15:18:10 -0500

Hi folks,

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?

Cheers, and thanks!

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.6.0, NS
appkit-2575.70 Version 15.6 (Build 24G84)) of 2025-08-03 built on Mac
Repository revision: e70723fcb7b9cf2daad92d563f97735892d758e1
Repository branch: spd-igc
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.6

Configured using:
'configure --with-ns --with-modules --with-native-compilation
--with-libgmp --with-tree-sitter --with-sqlite3 --with-mps=yes
--without-imagemagick --without-dbus CPPFLAGS=-I/opt/homebrew/include
LDFLAGS=-L/opt/homebrew/lib PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig
ac_cv_func_posix_spawn_file_actions_addchdir=no'

Configured features:
ACL GIF GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES MPS NATIVE_COMP NOTIFY
KQUEUE NS PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Special

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message yank-media rfc822 mml
mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums misearch multi-isearch cus-theme eieio-custom
eieio-base xwidget url-handlers image-mode dired dired-loaddefs exif
format-spec bookmark wid-browse tree-widget vhdl-mode verilog-mode diff
vera-mode hippie-exp tcl sql view simula sieve sieve-mode sieve-manage
sasl sasl-anonymous sasl-login sasl-plain sh-script executable
ruby-ts-mode ruby-mode python project compat pcase ps-mode prolog align
php-ts-mode html-ts-mode perl-mode pascal opascal octave rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-enc
xmltok modula2 meta-mode m4-mode lua-ts-mode ld-script js c-ts-common
info-look info icon hideshow heex-ts-mode fortran f90 ethio-util robin
elixir-ts-mode warnings dcl-mode tempo css-mode treesit smie sgml-mode
imenu eww track-changes vtable url-queue thingatpt shr pixel-fill
kinsoku url-file svg xml dom browse-url xdg url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util url-parse auth-source cl-seq eieio eieio-core
cl-macs password-cache json map byte-opt gv url-vars mailcap puny mm-url
gnus nnheader gnus-util time-date mail-utils range mm-util mail-prsvr
cperl-mode facemenu cfengine cfengine3 bat-mode asm-mode antlr-mode
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs compile text-property-search comint subr-x ansi-osc
ansi-color ring comp-run bytecomp byte-compile comp-common rx
ring-bell-fns pulse face-remap color cus-edit pp cus-start cus-load
icons wid-edit cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads kqueue
cocoa ns lcms2 multi-tty make-network-process tty-child-frames
native-compile mps emacs)

Memory information:
((conses 24 0 0) (symbols 56 0 0) (strings 40 0 0) (string-bytes 1 0)
(vectors 24 0) (vector-slots 8 0 0) (floats 24 0 0)
(intervals 64 0 0) (buffers 1072 0))