Subject: bug#77213: closed (Re: bug#77213: go-ts-mode trying to treesit-ready-p gomod without quiet)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 29 Mar 2025 10:39:02 +0000

Your bug report

#77213: go-ts-mode trying to treesit-ready-p gomod without quiet

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77213: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77213
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77213: go-ts-mode trying to treesit-ready-p gomod without quiet
From: Eli Zaretskii <[email-masked]>
To: Gergely Riskó <[email-masked]>
Cc: [email-masked]
Date: Sat, 29 Mar 2025 13:37:49 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Gergely Riskó <[email-masked]>
> Date: Sun, 23 Mar 2025 16:56:24 +0100
> 
> Hey,
> 
> In the last 2 lines of go-ts-mode.el we have this:
> 
> (if (treesit-ready-p 'gomod)
>     (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode)))
> 
> This is problematic, because the treesitter go shared library can be
> available when the gomod shared library is not.  (E.g. the official
> treesit bundle behaves like that.)
> 
> Now, this call to treesit-ready-p without the quiet flag causes a
> warning, that might frighten the user and might send the message that
> even their go configuration is somehow broken (and it's not).
> 
> The easy fix would be to just add the quiet flag here, and I think
> that should be done as soon a possible.

Thanks, now done on the emacs-30 release branch.

> But conceptually speaking, I'm not 100% sure that it's a good idea
> that gomod and go are so tightly coupled in the same file.  Editing go
> files is much more frequent while programming than editing gomod
> files.  If there are any issues with gomod (like now), it would be
> cool to be able to just turn it off (e.g. removing from
> auto-mode-alist), instead of it being force-loaded just because it's
> the same file as go-mode.

I didn't do this part, because if the gomod library is available, I
see no reason to disable it.

Subject: go-ts-mode trying to treesit-ready-p gomod without quiet
From: Gergely Riskó <[email-masked]>
To: [email-masked]
Date: Sun, 23 Mar 2025 16:56:24 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hey,

In the last 2 lines of go-ts-mode.el we have this:

(if (treesit-ready-p 'gomod)
    (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode)))

This is problematic, because the treesitter go shared library can be
available when the gomod shared library is not.  (E.g. the official
treesit bundle behaves like that.)

Now, this call to treesit-ready-p without the quiet flag causes a
warning, that might frighten the user and might send the message that
even their go configuration is somehow broken (and it's not).

The easy fix would be to just add the quiet flag here, and I think
that should be done as soon a possible.

But conceptually speaking, I'm not 100% sure that it's a good idea
that gomod and go are so tightly coupled in the same file.  Editing go
files is much more frequent while programming than editing gomod
files.  If there are any issues with gomod (like now), it would be
cool to be able to just turn it off (e.g. removing from
auto-mode-alist), instead of it being force-loaded just because it's
the same file as go-mode.

Cheers,
Gergely