unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
@ 2023-07-28  9:14 Robert Pluim
  2023-07-28 12:11 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Pluim @ 2023-07-28  9:14 UTC (permalink / raw)
  To: 64917

I built master with tree-sitter support, and installed the c-language
grammar using M-x treesit-install-language-grammar. I have
libtree-sitter-c.so in ~/.emacs.d/tree-sitter

I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
popped up a *Warnings* buffer containing:

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

which is less than desirable (althoug `major-mode' is c-ts-mode, so I
guess things worked)

Robert

In GNU Emacs 30.0.50 (build 24, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-07-28 built on rltb
Repository revision: a5dda9614a01ca753f25c904ccf7781176245b3c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Debian GNU/Linux 12 (bookworm)

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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-28  9:14 bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support Robert Pluim
@ 2023-07-28 12:11 ` Eli Zaretskii
  2023-07-28 13:31   ` Robert Pluim
  2023-07-29 17:46   ` Yuan Fu
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-28 12:11 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 64917

tags 64917 notabug
thanks

> From: Robert Pluim <rpluim@gmail.com>
> Date: Fri, 28 Jul 2023 11:14:15 +0200
> 
> I built master with tree-sitter support, and installed the c-language
> grammar using M-x treesit-install-language-grammar. I have
> libtree-sitter-c.so in ~/.emacs.d/tree-sitter
> 
> I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
> popped up a *Warnings* buffer containing:
> 
> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
> 
> which is less than desirable (althoug `major-mode' is c-ts-mode, so I
> guess things worked)

Please install the C++ grammar as well.  Those two go together because
some *.h files could be C or C++, and we can only test that at run
time.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-28 12:11 ` Eli Zaretskii
@ 2023-07-28 13:31   ` Robert Pluim
  2023-07-31  1:43     ` Richard Stallman
  2023-08-03  8:13     ` Eli Zaretskii
  2023-07-29 17:46   ` Yuan Fu
  1 sibling, 2 replies; 8+ messages in thread
From: Robert Pluim @ 2023-07-28 13:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64917

>>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz@gnu.org> said:

    Eli> tags 64917 notabug
    Eli> thanks

    Eli> Please install the C++ grammar as well.  Those two go together because
    Eli> some *.h files could be C or C++, and we can only test that at run
    Eli> time.

I had no intention of installing the C++ grammar, but I guess I have
no choice.

Some indication of that requirement at install time would help (as
well as an indication when installing that the grammar to install is
called 'cpp', not 'c++')

Robert
-- 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-28 12:11 ` Eli Zaretskii
  2023-07-28 13:31   ` Robert Pluim
@ 2023-07-29 17:46   ` Yuan Fu
  1 sibling, 0 replies; 8+ messages in thread
From: Yuan Fu @ 2023-07-29 17:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64917, Robert Pluim



> On Jul 28, 2023, at 5:11 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> tags 64917 notabug
> thanks
> 
>> From: Robert Pluim <rpluim@gmail.com>
>> Date: Fri, 28 Jul 2023 11:14:15 +0200
>> 
>> I built master with tree-sitter support, and installed the c-language
>> grammar using M-x treesit-install-language-grammar. I have
>> libtree-sitter-c.so in ~/.emacs.d/tree-sitter
>> 
>> I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which
>> popped up a *Warnings* buffer containing:
>> 
>> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
>> ⛔ Warning (treesit): Cannot activate tree-sitter, because language grammar for cpp is unavailable (not-found): (libtree-sitter-cpp libtree-sitter-cpp.0 libtree-sitter-cpp.0.0 libtree-sitter-cpp.so libtree-sitter-cpp.so.0 libtree-sitter-cpp.so.0.0) No such file or directory
>> 
>> which is less than desirable (althoug `major-mode' is c-ts-mode, so I
>> guess things worked)
> 
> Please install the C++ grammar as well.  Those two go together because
> some *.h files could be C or C++, and we can only test that at run
> time.

For future reference, that’s true but not the whole picture. The warning is caused by the call to (treesit-ready-p ‘cpp) at the end of c-ts-mode.el:

(if (treesit-ready-p 'cpp)
    (add-to-list 'auto-mode-alist
                 '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'"
                   . c++-ts-mode)))

There was a discussion on whether we want to use (treesit-ready-p ‘cpp t) which tests for the availability of cpp grammar but doesn’t raise a warning. And your decision was to keep the warning, IIRC.

And my understanding is that these code that modifies auto-mode-alist whenever c-ts-mode.el is loaded are temporary for Emacs 29, and in the future might be removed. If they are removed, the warning will be gone.

Yuan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-28 13:31   ` Robert Pluim
@ 2023-07-31  1:43     ` Richard Stallman
  2023-07-31  2:28       ` Eli Zaretskii
  2023-08-03  8:13     ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2023-07-31  1:43 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 64917, eliz

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

      > Eli> Please install the C++ grammar as well.  Those two go together because
      > Eli> some *.h files could be C or C++, and we can only test that at run
      > Eli> time.

I suggest we ought to make a way for a user who never operates on C++
programs to deactivate C++, deactivate this test, and not load
anything for C++.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-31  1:43     ` Richard Stallman
@ 2023-07-31  2:28       ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-07-31  2:28 UTC (permalink / raw)
  To: rms; +Cc: 64917, rpluim

> From: Richard Stallman <rms@gnu.org>
> Cc: eliz@gnu.org, 64917@debbugs.gnu.org
> Date: Sun, 30 Jul 2023 21:43:18 -0400
> 
>       > Eli> Please install the C++ grammar as well.  Those two go together because
>       > Eli> some *.h files could be C or C++, and we can only test that at run
>       > Eli> time.
> 
> I suggest we ought to make a way for a user who never operates on C++
> programs to deactivate C++, deactivate this test, and not load
> anything for C++.

If someone finds a way of doing that without any significant
downsides, I won't object.  It's just that we haven't found such a way
yet.

Btw, the Emacs tree already includes a few files in C++, so having
this grammar available is necessary for work on Emacs.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-07-28 13:31   ` Robert Pluim
  2023-07-31  1:43     ` Richard Stallman
@ 2023-08-03  8:13     ` Eli Zaretskii
  2023-08-09 15:27       ` Robert Pluim
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-08-03  8:13 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 64917

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 64917@debbugs.gnu.org
> Date: Fri, 28 Jul 2023 15:31:14 +0200
> 
> >>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz@gnu.org> said:
> 
>     Eli> tags 64917 notabug
>     Eli> thanks
> 
>     Eli> Please install the C++ grammar as well.  Those two go together because
>     Eli> some *.h files could be C or C++, and we can only test that at run
>     Eli> time.
> 
> I had no intention of installing the C++ grammar, but I guess I have
> no choice.
> 
> Some indication of that requirement at install time would help (as
> well as an indication when installing that the grammar to install is
> called 'cpp', not 'c++')

I don't really see a good place for mentioning this in a way that will
be discoverable enough.  Any suggestions?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support
  2023-08-03  8:13     ` Eli Zaretskii
@ 2023-08-09 15:27       ` Robert Pluim
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Pluim @ 2023-08-09 15:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64917-done

>>>>> On Thu, 03 Aug 2023 11:13:40 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Cc: 64917@debbugs.gnu.org
    >> Date: Fri, 28 Jul 2023 15:31:14 +0200
    >> 
    >> >>>>> On Fri, 28 Jul 2023 15:11:33 +0300, Eli Zaretskii <eliz@gnu.org> said:
    >> 
    Eli> tags 64917 notabug
    Eli> thanks
    >> 
    Eli> Please install the C++ grammar as well.  Those two go together because
    Eli> some *.h files could be C or C++, and we can only test that at run
    Eli> time.
    >> 
    >> I had no intention of installing the C++ grammar, but I guess I have
    >> no choice.
    >> 
    >> Some indication of that requirement at install time would help (as
    >> well as an indication when installing that the grammar to install is
    >> called 'cpp', not 'c++')

    Eli> I don't really see a good place for mentioning this in a way that will
    Eli> be discoverable enough.  Any suggestions?

I donʼt either. Closing

Robert
-- 





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-09 15:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  9:14 bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support Robert Pluim
2023-07-28 12:11 ` Eli Zaretskii
2023-07-28 13:31   ` Robert Pluim
2023-07-31  1:43     ` Richard Stallman
2023-07-31  2:28       ` Eli Zaretskii
2023-08-03  8:13     ` Eli Zaretskii
2023-08-09 15:27       ` Robert Pluim
2023-07-29 17:46   ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).