Subject: bug#79215: 31.0.50; emacs build fails with tree-sitter (bisected)

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Aug 2025 19:54:10 +0300

> From: Juri Linkov <[email-masked]>
> Cc: German Pacenza <[email-masked]>,  Vincenzo Pupillo
>  <[email-masked]>,  [email-masked]
> Date: Mon, 11 Aug 2025 19:20:24 +0300
> 
> > Thanks.  Does the patch below fix the problem?
> > [...]
> > -   (when (treesit-ensure-installed 'jsdoc)
> > +   (when (treesit-language-available-p 'jsdoc t)
> 
> 'c-ts-mode' uses such a nice solution that the 'doxygen' grammar
> that more-less corresponds to the 'jsdoc' grammar has
> a user option 'c-ts-mode-enable-doxygen' that is used like this:
> 
>       (when (and c-ts-mode-enable-doxygen
>                  (treesit-ensure-installed 'doxygen))
> 
> 'jsdoc' could do the same with a new option
> 'js-ts-mode-enable-jsdoc'.

The above code is not run when mhtml-ts-mode is activated, it is run
when the file is loaded, because it is part of the default value of a
defvar.  So in that case we simply should silently avoid the
evaluation if the grammar is not available, regardless of the user
option, I think.

I do agree that a similar option could be a good idea for
mhtml-ts-mode, but that would be unrelated to this code.