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#60888: 29.0.60; Lost c-or-c++-ts-mode Date: Fri, 20 Jan 2023 14:19:35 -0800 Message-ID: <2A1561B3-7852-47EE-ACF5-056A12FAA835@gmail.com> References: <868ri18ms5.fsf@mail.linkov.net> <36C3AE10-1F2E-428D-AE5B-2ADF1732433C@gmail.com> <838rhxob23.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) 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="6999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60888@debbugs.gnu.org, juri@linkov.net, Dmitry Gutov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 20 23:20:23 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 1pIzkE-0001Yx-Fs for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Jan 2023 23:20:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIzjw-0007VY-Tk; Fri, 20 Jan 2023 17:20: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 1pIzju-0007VN-UW for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 17:20: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 1pIzju-0007Ox-BI for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 17:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIzjt-0003Ft-Ra for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2023 17:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2023 22:20:01 +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.167425319612494 (code B ref 60888); Fri, 20 Jan 2023 22:20:01 +0000 Original-Received: (at 60888) by debbugs.gnu.org; 20 Jan 2023 22:19:56 +0000 Original-Received: from localhost ([127.0.0.1]:47420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIzjn-0003FS-Ji for submit@debbugs.gnu.org; Fri, 20 Jan 2023 17:19:55 -0500 Original-Received: from mail-pj1-f52.google.com ([209.85.216.52]:38701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIzjl-0003FA-C4 for 60888@debbugs.gnu.org; Fri, 20 Jan 2023 17:19:54 -0500 Original-Received: by mail-pj1-f52.google.com with SMTP id k10-20020a17090a590a00b0022ba875a1a4so3370479pji.3 for <60888@debbugs.gnu.org>; Fri, 20 Jan 2023 14:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=kt2Od+reX7uNM2u8i/BM19kuoKXU452nl1emONXgFkY=; b=Dsc3o3n9qZU15BQtQ4/E9QaiCK9k8ZVUL4W/JJwIHz/yssTfbl42u+xxpdE3RTn4Dc YPz2Uq/Af9detDgT3S6ieukws84YCa9pYXKwoZtxf1iiMhrj9BQ7Cf+1d+o990KCCNAM s2fxOjDqEgfJNTXOmp1Yaw5p9iYxnCeea4TM0n2pAK0mDqdKdVrE+Tsf75JsJ9P0T/BA oa+OfSn3gpx9cU3rDG8GEVwIbXrJychei14I55SzjEVu8QcOOAZ+EzlXOgYnb1pOxQqS +z1OTZgQr7uWFq6exwERcq7s5VnvrJspiFK9xHSRyMzRgVQiS0nREUyq6s6jc6F4DXoJ riMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kt2Od+reX7uNM2u8i/BM19kuoKXU452nl1emONXgFkY=; b=EIdWE17PGzZe4OK97cf8iXo4ZSf3qCLJ5BEwmMgUp8BKjeR8nPRdWZTmXoFe4xpXGH jkGgc1WHQMA06qrI41fwElwxSXq4i/jBhzc71vBJ/JgmN30RWtcy4AsVAe7DhoADiVHn MG4c66K9Z7SJIDKU7MpGbnjKzJoZSEYTx5eevh7jnYF7TyTjHuFophbrB3NzDx1L4kHO x9nhLxlLt+5Vg5uFmAps4+1MxpJ53rYya9o/bsNmR/JLfkljWw9oHECFS4n1rKuNvytZ QGdjURfHRfaPQbeoMnc0/2ws5DmloRTwnIBPm8RQT9CL8/FA7Ztd817baDSdPlOhWrzI QOrw== X-Gm-Message-State: AFqh2kpLJyvX2Ybr6b6oSgJndQj5a0CDz5G0PWHBMy8gAMsE8jUsOU7C g6X4PaYQ1MiOuryOHme+5bo= X-Google-Smtp-Source: AMrXdXtACjeO2fE0aRwjJEMGw6VQYE9cUBf6rB4OBswd3hHm/TX8n0huokZ2yBUeJU8jnaVf1w8dXg== X-Received: by 2002:a05:6a20:ba87:b0:af:8e92:3eeb with SMTP id fb7-20020a056a20ba8700b000af8e923eebmr16348292pzb.9.1674253187369; Fri, 20 Jan 2023 14:19:47 -0800 (PST) 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 q25-20020a631f59000000b004cffa8c0227sm5614690pgm.23.2023.01.20.14.19.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2023 14:19:47 -0800 (PST) In-Reply-To: <838rhxob23.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.300.101.1.3) 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:253810 Archived-At: > On Jan 20, 2023, at 12:38 AM, Eli Zaretskii wrote: >=20 >> Cc: 60888@debbugs.gnu.org, Juri Linkov >> From: Yuan Fu >> Date: Thu, 19 Jan 2023 13:57:17 -0800 >>=20 >>=20 >> Dmitry Gutov writes: >>=20 >>> 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. >>>=20 >>> Apparently it was decided that it's a new feature, and thus too late >>> for emacs-29. >>=20 >> 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. >=20 > 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. >=20 > 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. >=20 > Thanks. Weird, I literally copied c-or-c++-mode. Let me see what=E2=80=99s going = on. Yuan=