From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#64917: 30.0.50; c-ts-mode throws warnings about missing cpp support Date: Sat, 29 Jul 2023 10:46:18 -0700 Message-ID: <5214C555-78D9-4669-B951-82FC25D98756@gmail.com> References: <87zg3gxus8.fsf@gmail.com> <83edksjkwa.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17105"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64917@debbugs.gnu.org, Robert Pluim To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 29 20:14:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qPoS4-0004F5-Gh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jul 2023 20:14:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPo20-0006Pk-9v; Sat, 29 Jul 2023 13:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPo1u-0006P5-Jf for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 13:47:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qPo1u-0004qn-CD for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 13:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPo1t-0006dh-Ss for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 13:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jul 2023 17:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64917 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 64917-submit@debbugs.gnu.org id=B64917.169065279925494 (code B ref 64917); Sat, 29 Jul 2023 17:47:01 +0000 Original-Received: (at 64917) by debbugs.gnu.org; 29 Jul 2023 17:46:39 +0000 Original-Received: from localhost ([127.0.0.1]:48978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPo1X-0006d7-CF for submit@debbugs.gnu.org; Sat, 29 Jul 2023 13:46:39 -0400 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:57586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPo1V-0006ct-CP for 64917@debbugs.gnu.org; Sat, 29 Jul 2023 13:46:38 -0400 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbf8cb61aeso4780345ad.2 for <64917@debbugs.gnu.org>; Sat, 29 Jul 2023 10:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690652791; x=1691257591; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1e6X9aY3gQWkn4eOwMndCS2aQePr7mcc6ucTlvnRNYc=; b=F7p0W1fea3m9xIyZG7muvZVxKBJ9TDZEayYX1OS6Z2btLH0YkEz4WvIqybiLcMTmY9 iHB6KIQ0bYY4ZY3WbUsL6UMjFpDJpd+h3eOLdVJrk9mEFNu9AvpgNzvFTRN+I5k0qvdv fWh/wsLam+YH5BqhnLxRSFsvQzh5sjRXGtVEQvyFcFhB33hi3/jtNC48ivG8TtjoiQvU citzeE5mdsebHvg6Dl+fcdpxP46BKseUcfHgs8aWiC8gniCT95+IHAlCwR5cox7MW/K3 JxMTXShLrvErfvo23LpTydlYGUwwO3QnifgAqAOyKT3vIS9XViZ1sG/Y+E6ILlF7g10P 09ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690652791; x=1691257591; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1e6X9aY3gQWkn4eOwMndCS2aQePr7mcc6ucTlvnRNYc=; b=Vx3N0RTFIUnoMJWEf+jn7hLsT7BIF2kx18pCcTkfV1ZUXAcKAR/0O46TNTfZjljm+p nD3qvIkw1Ys4ycDiGk5rtEu+tG/j2MwRdH47woNYBbxyYh/Lf3rW2gyiQr/iW+gfOdwi NTRKkDxQfbkCDaiSzjNLhTplli6DUIIozw9E9L1riYpnwSDzfHbHhuVo8Re2DjcAscD7 2nHwLuwpvYW+QkNmtrfHm7neohyPU1cg9nTtt80Kscz3GeJdVvz57/GsMMWjKUuUo9La pWKBSJGa/+SwwgPI8zgeuOBtA0y/Yyca9cFh3Wmge+Ac7IypUN3Nak33jkbCVdKV+7ag eJ2g== X-Gm-Message-State: ABy/qLYQh7rBkNeilIiyFmb3QST6nPHIJkhUf1irGx8OI0ZGVPfk91vb D64VS/DvwCh6W8AQ7IHmz9s= X-Google-Smtp-Source: APBJJlEYbs/6wAJ/TGnhL0idNW/lniG+rxQeLahngIqGGKnjL5WDrnXSLa9Cn4I88oXbAVjH3KbG/w== X-Received: by 2002:a17:902:988e:b0:1b6:72af:623d with SMTP id s14-20020a170902988e00b001b672af623dmr5052116plp.55.1690652791192; Sat, 29 Jul 2023 10:46:31 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id v4-20020a170902b7c400b001bb3beb2bc6sm5590260plz.65.2023.07.29.10.46.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2023 10:46:30 -0700 (PDT) In-Reply-To: <83edksjkwa.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266338 Archived-At: > On Jul 28, 2023, at 5:11 AM, Eli Zaretskii wrote: >=20 > tags 64917 notabug > thanks >=20 >> From: Robert Pluim >> Date: Fri, 28 Jul 2023 11:14:15 +0200 >>=20 >> 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 >>=20 >> I restarted emacs, visited src/xdisp.c, and did M-x c-ts-mode, which >> popped up a *Warnings* buffer containing: >>=20 >> =E2=9B=94 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 >> =E2=9B=94 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 >>=20 >> which is less than desirable (althoug `major-mode' is c-ts-mode, so I >> guess things worked) >=20 > 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=E2=80=99s true but not the whole picture. The = warning is caused by the call to (treesit-ready-p =E2=80=98cpp) 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\\|\\+\\+\\)\\|\\.\\(c= c\\|hh\\)\\)\\'" . c++-ts-mode))) There was a discussion on whether we want to use (treesit-ready-p =E2=80=98= cpp t) which tests for the availability of cpp grammar but doesn=E2=80=99t= 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=