GNU bug report logs - #64487
29.0.92; Another tree-sitter warning inside Custom

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Thu, 6 Jul 2023 06:58:01 UTC

Severity: normal

Found in version 29.0.92

To reply to this bug, email your comments to 64487 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Thu, 06 Jul 2023 06:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Po Lu <luangruo <at> yahoo.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Jul 2023 06:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.92; Another tree-sitter warning inside Custom
Date: Thu, 06 Jul 2023 14:56:44 +0800
Type M-x customize RET.  Click Programming and then Languages.  A
*Warnings* buffer will be displayed containing the following message:

  Warning (treesit): Cannot activate tree-sitter, because language
  grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
  libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
  libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
  directory

Can't these messages only be displayed when a tree-sitter major mode is
enabled, as opposed to whenever the file implementing the major mode is
loaded?

Thanks.

In GNU Emacs 29.0.92 (build 1, x86_64-pc-linux-gnu) of 2023-06-25 built
 on trinity
Windowing system distributor 'Sun Microsystems, Inc', version 11.0.6620
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-x-toolkit=no --without-cairo
 --with-native-compilation=aot'

Configured features:
ACL DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER
WEBP X11 XDBE XFT XIM XINPUT2 XPM ZLIB

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Special




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Thu, 06 Jul 2023 09:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Thu, 06 Jul 2023 12:12:25 +0300
> Date: Thu, 06 Jul 2023 14:56:44 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Type M-x customize RET.  Click Programming and then Languages.  A
> *Warnings* buffer will be displayed containing the following message:
> 
>   Warning (treesit): Cannot activate tree-sitter, because language
>   grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
>   libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
>   libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
>   directory

When you customize a group, Custom loads all the packages that belong
to the group.  So in this case it loads ruby-ts-mode, and you get the
warning.

> Can't these messages only be displayed when a tree-sitter major mode is
> enabled, as opposed to whenever the file implementing the major mode is
> loaded?

Emacs 29 deliberately checks for the grammar's availability when the
package is loaded, to give users a prominent indication that the
loaded package will not work.  This won't change in Emacs 29, but
maybe as part of rethinking this after releasing Emacs 29 we could
improve the situation with customizing a group as well.

Anyway, the warning is just a warning, and is otherwise harmless.  It
also only appears when Emacs has been built with tree-sitter, but the
grammar libraries required by some *-ts-mode's are not installed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Mon, 26 Feb 2024 11:21:02 GMT) Full text and rfc822 format available.

Message #11 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Willcock <morgan <at> ice9.digital>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Po Lu <luangruo <at> yahoo.com>, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Mon, 26 Feb 2024 11:13:40 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Thu, 06 Jul 2023 14:56:44 +0800
>> From:  Po Lu via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Type M-x customize RET.  Click Programming and then Languages.  A
>> *Warnings* buffer will be displayed containing the following message:
>> 
>>   Warning (treesit): Cannot activate tree-sitter, because language
>>   grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
>>   libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
>>   libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
>>   directory
>
> When you customize a group, Custom loads all the packages that belong
> to the group.  So in this case it loads ruby-ts-mode, and you get the
> warning.
>
>> Can't these messages only be displayed when a tree-sitter major mode is
>> enabled, as opposed to whenever the file implementing the major mode is
>> loaded?
>
> Emacs 29 deliberately checks for the grammar's availability when the
> package is loaded, to give users a prominent indication that the
> loaded package will not work.  This won't change in Emacs 29, but
> maybe as part of rethinking this after releasing Emacs 29 we could
> improve the situation with customizing a group as well.
>
> Anyway, the warning is just a warning, and is otherwise harmless.  It
> also only appears when Emacs has been built with tree-sitter, but the
> grammar libraries required by some *-ts-mode's are not installed.

I don't think this situation will be particularly rare for people who
choose to download the pre-built Windows binaries.

And I imagine that people choosing to acquire and run the program this
way (possibly because they do not know how to build the program
themselves) would probably be confused as to why the "out-of-the-box"
experience is generating warnings for features they are not actively
trying to use.

-- 
Morgan Willcock




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Mon, 26 Feb 2024 17:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Mon, 26 Feb 2024 19:02:43 +0200
> Date: Mon, 26 Feb 2024 18:55:09 +0200
> Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> I remember you saying that it was a question which is settled until any 
> other problems come up. Isn't this an example of such problem?

No, I don't think so.  It is a very special case, which is rarely a
problem (only if the user decides eventually not to activate the
mode).

> >> Do I understand it right that performing the simple steps that Po Lu
> >> outlined would silently assign ruby-ts-mode to *.rb files? And a bunch
> >> of other such modes that get loaded as well. But only until the end of
> >> the session.
> > 
> > Could be, I didn't try.  If that's what happens, patches to avoid such
> > a long-lasting effect, without changing what happens when the package
> > is loaded outside of the Customize context, will be welcome.
> 
> I don't have any solutions to suggest except holding to the principle 
> that simply loading a package has as few side-effects as possible. Which 
> would mean reverting your earlier decision.

I don't see a reason for such radical solutions because of this use
case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Mon, 26 Feb 2024 17:09:02 GMT) Full text and rfc822 format available.

Message #17 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Mon, 26 Feb 2024 18:49:30 +0200
> Date: Mon, 26 Feb 2024 18:25:33 +0200
> Cc: 64487 <at> debbugs.gnu.org
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> On 06/07/2023 12:12, Eli Zaretskii wrote:
> >> Date: Thu, 06 Jul 2023 14:56:44 +0800
> >> From:  Po Lu via "Bug reports for GNU Emacs,
> >>   the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >>
> >> Type M-x customize RET.  Click Programming and then Languages.  A
> >> *Warnings* buffer will be displayed containing the following message:
> >>
> >>    Warning (treesit): Cannot activate tree-sitter, because language
> >>    grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
> >>    libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
> >>    libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
> >>    directory
> > 
> > When you customize a group, Custom loads all the packages that belong
> > to the group.  So in this case it loads ruby-ts-mode, and you get the
> > warning.
> 
> Which was never a problem before when simply loading a package didn't 
> alter auto-mode-alist.

You want to start that old dispute again?  I didn't expect you to
change your opinions, and you shouldn't expect me to change mine.  So
why restart that?

> Do I understand it right that performing the simple steps that Po Lu 
> outlined would silently assign ruby-ts-mode to *.rb files? And a bunch 
> of other such modes that get loaded as well. But only until the end of 
> the session.

Could be, I didn't try.  If that's what happens, patches to avoid such
a long-lasting effect, without changing what happens when the package
is loaded outside of the Customize context, will be welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Mon, 26 Feb 2024 17:11:02 GMT) Full text and rfc822 format available.

Message #20 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Mon, 26 Feb 2024 18:55:09 +0200
On 26/02/2024 18:49, Eli Zaretskii wrote:
>> Date: Mon, 26 Feb 2024 18:25:33 +0200
>> Cc: 64487 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dmitry <at> gutov.dev>
>>
>> On 06/07/2023 12:12, Eli Zaretskii wrote:
>>>> Date: Thu, 06 Jul 2023 14:56:44 +0800
>>>> From:  Po Lu via "Bug reports for GNU Emacs,
>>>>    the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>>>
>>>> Type M-x customize RET.  Click Programming and then Languages.  A
>>>> *Warnings* buffer will be displayed containing the following message:
>>>>
>>>>     Warning (treesit): Cannot activate tree-sitter, because language
>>>>     grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
>>>>     libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
>>>>     libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
>>>>     directory
>>>
>>> When you customize a group, Custom loads all the packages that belong
>>> to the group.  So in this case it loads ruby-ts-mode, and you get the
>>> warning.
>>
>> Which was never a problem before when simply loading a package didn't
>> alter auto-mode-alist.
> 
> You want to start that old dispute again?  I didn't expect you to
> change your opinions, and you shouldn't expect me to change mine.  So
> why restart that?

I remember you saying that it was a question which is settled until any 
other problems come up. Isn't this an example of such problem?

>> Do I understand it right that performing the simple steps that Po Lu
>> outlined would silently assign ruby-ts-mode to *.rb files? And a bunch
>> of other such modes that get loaded as well. But only until the end of
>> the session.
> 
> Could be, I didn't try.  If that's what happens, patches to avoid such
> a long-lasting effect, without changing what happens when the package
> is loaded outside of the Customize context, will be welcome.

I don't have any solutions to suggest except holding to the principle 
that simply loading a package has as few side-effects as possible. Which 
would mean reverting your earlier decision.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Mon, 26 Feb 2024 17:23:01 GMT) Full text and rfc822 format available.

Message #23 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, Po Lu <luangruo <at> yahoo.com>
Cc: 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Mon, 26 Feb 2024 18:25:33 +0200
On 06/07/2023 12:12, Eli Zaretskii wrote:
>> Date: Thu, 06 Jul 2023 14:56:44 +0800
>> From:  Po Lu via "Bug reports for GNU Emacs,
>>   the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> Type M-x customize RET.  Click Programming and then Languages.  A
>> *Warnings* buffer will be displayed containing the following message:
>>
>>    Warning (treesit): Cannot activate tree-sitter, because language
>>    grammar for ruby is unavailable (not-found): (libtree-sitter-ruby
>>    libtree-sitter-ruby.0 libtree-sitter-ruby.0.0 libtree-sitter-ruby.so
>>    libtree-sitter-ruby.so.0 libtree-sitter-ruby.so.0.0) No such file or
>>    directory
> 
> When you customize a group, Custom loads all the packages that belong
> to the group.  So in this case it loads ruby-ts-mode, and you get the
> warning.

Which was never a problem before when simply loading a package didn't 
alter auto-mode-alist.

>> Can't these messages only be displayed when a tree-sitter major mode is
>> enabled, as opposed to whenever the file implementing the major mode is
>> loaded?
> 
> Emacs 29 deliberately checks for the grammar's availability when the
> package is loaded, to give users a prominent indication that the
> loaded package will not work.  This won't change in Emacs 29, but
> maybe as part of rethinking this after releasing Emacs 29 we could
> improve the situation with customizing a group as well.
> 
> Anyway, the warning is just a warning, and is otherwise harmless.  It
> also only appears when Emacs has been built with tree-sitter, but the
> grammar libraries required by some *-ts-mode's are not installed.

Suppose the grammar is actually available. Perhaps the user had compiled 
it at some point, or perhaps it's installed system-wide due to another 
dependency.

Do I understand it right that performing the simple steps that Po Lu 
outlined would silently assign ruby-ts-mode to *.rb files? And a bunch 
of other such modes that get loaded as well. But only until the end of 
the session.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Tue, 27 Feb 2024 04:25:02 GMT) Full text and rfc822 format available.

Message #26 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Tue, 27 Feb 2024 06:23:36 +0200
On 26/02/2024 19:02, Eli Zaretskii wrote:
>> Date: Mon, 26 Feb 2024 18:55:09 +0200
>> Cc:luangruo <at> yahoo.com,64487 <at> debbugs.gnu.org
>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>
>> I remember you saying that it was a question which is settled until any
>> other problems come up. Isn't this an example of such problem?
> No, I don't think so.  It is a very special case, which is rarely a
> problem (only if the user decides eventually not to activate the
> mode).

Which mode, though?

The sequence of actions does not pertain to any particular mode: it's 
just Customize -> Programming -> Languages.

Going through these steps with 'emacs -Q' here, I got both a warning 
about the missing lua grammar (14 lines tall), and both ruby-ts-mode and 
 elixir-ts-mode added to auto-mode-alist, which weren't there before.

And then visiting the "C" node (which is not specific to the tree-sitter 
modes, to be clear -- it's mostly CC Mode variables), I get also 
c-ts-mode, c++-ts-mode and c-or-c++-ts-mode added there.

There would be more modes added, but apparently some use groups with no 
parent defined (such as 'java' or 'json'), so they're not reachable from 
the general Customize interface.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64487; Package emacs. (Tue, 27 Feb 2024 08:13:01 GMT) Full text and rfc822 format available.

Message #29 received at 64487 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
Subject: Re: bug#64487: 29.0.92; Another tree-sitter warning inside Custom
Date: Tue, 27 Feb 2024 10:11:07 +0200
> Date: Tue, 27 Feb 2024 06:23:36 +0200
> Cc: luangruo <at> yahoo.com, 64487 <at> debbugs.gnu.org
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> On 26/02/2024 19:02, Eli Zaretskii wrote:
> >> Date: Mon, 26 Feb 2024 18:55:09 +0200
> >> Cc:luangruo <at> yahoo.com,64487 <at> debbugs.gnu.org
> >> From: Dmitry Gutov<dmitry <at> gutov.dev>
> >>
> >> I remember you saying that it was a question which is settled until any
> >> other problems come up. Isn't this an example of such problem?
> > No, I don't think so.  It is a very special case, which is rarely a
> > problem (only if the user decides eventually not to activate the
> > mode).
> 
> Which mode, though?

The one(s) that are of interest for the user.





This bug report was last modified 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.