From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60888: 29.0.60; Lost c-or-c++-ts-mode Date: Fri, 20 Jan 2023 10:38:28 +0200 Message-ID: <838rhxob23.fsf@gnu.org> References: <868ri18ms5.fsf@mail.linkov.net> <36C3AE10-1F2E-428D-AE5B-2ADF1732433C@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10637"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60888@debbugs.gnu.org, juri@linkov.net, dgutov@yandex.ru To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 20 09:40:27 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 1pImwk-0002bL-Ba for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Jan 2023 09:40:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pImwO-0005GM-Hb; Fri, 20 Jan 2023 03:40:04 -0500 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 1pImwM-0005Fp-PY for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 03:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pImwM-0008Ju-FZ for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 03:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pImwM-0004IK-C0 for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 03:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 08:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60888 X-GNU-PR-Package: emacs Original-Received: via spool by 60888-submit@debbugs.gnu.org id=B60888.167420394216429 (code B ref 60888); Fri, 20 Jan 2023 08:40:02 +0000 Original-Received: (at 60888) by debbugs.gnu.org; 20 Jan 2023 08:39:02 +0000 Original-Received: from localhost ([127.0.0.1]:45452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pImvO-0004Gk-3e for submit@debbugs.gnu.org; Fri, 20 Jan 2023 03:39:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pImvL-0004GO-1d for 60888@debbugs.gnu.org; Fri, 20 Jan 2023 03:39:00 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pImvD-00087W-P6; Fri, 20 Jan 2023 03:38:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=A1uissefqCpbrHqk88/JCrXy9Iauw1pKYETtS8/PIto=; b=WTEGIT4ORdet ANs52HjeXbrY6OnfJ8QVWxUsfY2HiOTipD4sSrG/ev31UndA/I8q848BETQ6U80zJhgkmDvaVR3OR qQ3wodqqcMwOzN+4D3CHhtX20hmNq6sA1g4yNluc7UUH6vKbXyoTUTWIgnDtBO2SN+ga337k0wEMm UoZUMvQSE/zdU87ozWrdjWDhlWxU4+CWv1+RunBcidwChvnId0YRqOmZEEAes0twXSbScQ7Nwe3Jm 7LaE+HdFUSWgOJ8FtcQP53YN+MHHczcy9E/su7bNsQcRsd3MC/TqD1xvZDdLWt6J14nMMPCQWhKjn CGvan9EBBHCzsFUIFfmzRQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pImus-0001C4-NR; Fri, 20 Jan 2023 03:38:33 -0500 In-Reply-To: <36C3AE10-1F2E-428D-AE5B-2ADF1732433C@gmail.com> (message from Yuan Fu on Thu, 19 Jan 2023 13:57:17 -0800) 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:253756 Archived-At: > Cc: 60888@debbugs.gnu.org, Juri Linkov > From: Yuan Fu > Date: Thu, 19 Jan 2023 13:57:17 -0800 > > > Dmitry Gutov writes: > > > On 17/01/2023 19:20, Juri Linkov wrote: > >> I started to rely on c-or-c++-ts-mode because there is no other replacement > >> to use for such mappings in init files: > >> (when (and (treesit-ready-p 'c t) (treesit-ready-p 'cpp t)) > >> (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))) > >> c-or-c++-mode is activated for all .h files, so there should be the > >> corresponding > >> c-or-c++-ts-mode, but it's lost somewhere in emacs-29. > > > > Apparently it was decided that it's a new feature, and thus too late > > for emacs-29. > > I added it back. It really is a bug preventing one to use c(++)-ts-mode > on header files. So this should be fine to add. Plus I mostly just > copy-pasted from cc-mode. Sorry for the back-and-forth. Yuan, something is still amiss here: there's a difference in the decision whether C or C++ mode should be used between c-or-c++-mode and c-or-c++-ts-mode. For example, visit the file dwarf2/line-header.h file from the recent GDB tree: c-or-c++-mode decides (correctly) that it's C++, but c-or-c++-ts-mode decides that it's C. In general, try header files from GDB: GDB is written in C++, but many *.h files kept their original *.h names, so you have a lot of testing cases there. I see quite a few of them where c-or-c++-ts-mode decides incorrectly for some reason. Thanks.