From unknown Thu Sep 11 06:21:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60047: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2022 20:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60047 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 60047@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167096428327901 (code B ref -1); Tue, 13 Dec 2022 20:45:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Dec 2022 20:44:43 +0000 Received: from localhost ([127.0.0.1]:34550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5C8p-0007Fx-68 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 15:44:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:44652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5C8o-0007Fr-6w for submit@debbugs.gnu.org; Tue, 13 Dec 2022 15:44:42 -0500 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 1p5C8m-0000Z1-6Z for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 15:44:41 -0500 Received: from sonic305-21.consmr.mail.ir2.yahoo.com ([77.238.177.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5C8i-0003y4-KG for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 15:44:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1670964272; bh=D+vBkhcReoAyhXa4YpSFiNor/0dICpi02Mf9+HpV0as=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=WJBSlZITGRboM7FdMZKIFgfQW3Fm96Ds4EiKbbsUFQEZg+I810RPS2lF680jBZB8tW3kmrSVk4LVM2fNmsLMmglA6E5zidLKmvtmcmYmEeaPgLytK260g8R11VCXzwLixUPdKFTWu8q8flRkqO+TrUMy/lmkELiPNTKrWIHdKVtCoKb3M6OgSPevdZLg2jSa5NXrqt55PWjfNM6s37jIpr7yYwfwtRCWjKQaSI0ceNlZP6q+KJxtFqeZ2OpTB00rMAXVlE5FiBuoPIhgxA+yZmUGjZuVJFRbaclIt+vSOpw76/Uxk15nWwDn7i6c/zwA8Tn8ckCrPxfn9+XElXWllw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670964272; bh=1Hgd0RCBhVZM8SvEjPhnbeNfSOjyAYhtPEyYSWyzX4p=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=KecfuGXrwg26WDzdKNwAlGWmu65mLKJHKpk9y0XX80dBR2VyqdCrsNXFqJ9lthdmU5q6uPZelLZ4cc/mZEoLrM4NFOU8bUgBhX0fuahNia40LGmKpkbsj8fiMdQiLeMYBuJ6ODIXQW7pt2R9EPVMpo0hloutF00jqstiz9e6rGAGe0eRDbNrMLIjeCUyzkbx0H9MmU48xf6X+SoCXczMKVVaZmwk2rc6Zo3ZRvsismV4XYyXxLkP/Gya/TfsKTuN9DOrt6Eg1t4NLtaxtFl5EGP3lA3NVYbgnr3XIwLgIQNneMSARHUu4ILr3GXzUK0Ca9ha9K9OwTrQkClXPX8THw== X-YMail-OSG: 43zAO4YVM1lYitZXtREuyJtVK1PzFsoS26B0iVI4axkUHQJ8LeFeCXNDkTgHJlO qXWEUqCQiaRIQSJzc5gidEPAhGARWDfyOghSoQyYCuPTUdGeA.xbXpstZk8qKrd_uCiCBTD7_sCb AXoO8EmipK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mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Tue, 13 Dec 2022 20:44:32 +0000 Received: by hermes--production-ir2-5795fc58c8-kh698 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b142cd5de79f8a7c6e5f368e096a628d; Tue, 13 Dec 2022 20:44:29 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Date: Tue, 13 Dec 2022 21:44:28 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: X-Mailer: WebService/1.1.20926 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1555 Received-SPF: pass client-ip=77.238.177.83; envelope-from=mardani29@yahoo.es; helo=sonic305-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch The attached patch makes C-M-a/C-M-e inside a C++ class definition in c++-ts-mode go to the beginning or the end of the class, respectively. I've added it to the base mode because I think it's harmless for C, and it can be convenient if we implement an Obj-C mode based on Tree-sitter. Thanks. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Treat-C-classes-as-defuns-in-C-Tree-sitter-mode.patch >From 008ce6794281fd606df8161af5ed65b267be0664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Tue, 13 Dec 2022 21:35:40 +0100 Subject: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier" as a node of type "defun". --- lisp/progmodes/c-ts-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 0d0a14e933..8407be3b6b 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -553,7 +553,8 @@ c-ts-base-mode "type_definition" "struct_specifier" "enum_specifier" - "union_specifier"))) + "union_specifier" + "class_specifier"))) ;; Nodes like struct/enum/union_specifier can appear in ;; function_definitions, so we need to find the top-level node. -- 2.34.1 --=-=-=-- From unknown Thu Sep 11 06:21:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Subject: bug#60047: closed (Re: bug#60047: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode) Message-ID: References: X-Gnu-PR-Message: they-closed 60047 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 60047@debbugs.gnu.org Date: Wed, 14 Dec 2022 02:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1670983982-1152-1" This is a multi-part message in MIME format... ------------=_1670983982-1152-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #60047: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 60047@debbugs.gnu.org. --=20 60047: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60047 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1670983982-1152-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 60047-done) by debbugs.gnu.org; 14 Dec 2022 02:12:11 +0000 Received: from localhost ([127.0.0.1]:35970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HFi-0000I8-LW for submit@debbugs.gnu.org; Tue, 13 Dec 2022 21:12:10 -0500 Received: from mail-pg1-f178.google.com ([209.85.215.178]:35518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5HFh-0000I0-GT for 60047-done@debbugs.gnu.org; Tue, 13 Dec 2022 21:12:10 -0500 Received: by mail-pg1-f178.google.com with SMTP id f3so1096305pgc.2 for <60047-done@debbugs.gnu.org>; Tue, 13 Dec 2022 18:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=ClS1UR15kFjPwDtRjLVz9XqHsa9zYt6ttoEDZT0gUmA=; b=jt8DIuAnbuPD4XJHrEhaDf4f1HrLC/h4maV38CDBXvMfkuRZvl/3YSGRfvofBPcMUj M2M65AkEAqa6Bxxb9WLAG3nZjQwoMKBI6Z8yKpgb3yYBHO0Cuo7Iah71cABHV/SmlsPm a/aRnbdRaDFQIwUAOAuIJZj1UmpgmM/fvsDb+MVgsHrr3fvenhBOq3CDKsfp8uguOoaq bLqQ8Y0E9T36d1/d49cX/DJd3fuuizFn6y4RA83TOKDDcxZybruoQyXpICth2tFi/ATe 0QD5Ytrl2gxtI2/fZ86XJj0zivBXU7GVYA0fMMXiQCzqzChoNgA+ck9QHUSQ9bxHb89T B9Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ClS1UR15kFjPwDtRjLVz9XqHsa9zYt6ttoEDZT0gUmA=; b=m8e6H2bLcJP3+kb3CgtPtqgynGbth7JhLQY0FedMl6UNfndHy34Ac0ecdzCx9ZE0kP m34035GrFp8WdoJlZEWcchV0Wda+vbTsX4Xhy35wMfPhV5C+OPxlHPYUx/FeSXR5yZ0M EAwFmf15QFPOVZC8/yDJTchIDGDUq/V6eaEZ9vLbcJL5aHzSMx9l3BUT3FzLNZG4KMNP kS2skZvbcGVApRmwRsopTJG3axVhrJKWrE3XI4rjWUytZNohVBy+v4ZUAA8MQ0ZlGNz7 tUSryxPfk857v7tHcuffGAUL/xy5QFJBvMvGoKzjimBdeTK8lNPKAgy8Z9pw+2suTdWV Xanw== X-Gm-Message-State: ANoB5pkPgxcdC+sf8gS/GkFOZUgMfPiRH+zYP7YesKBiqzkOhPw/nCWL C6lcmrF5GnGaRE837JBMocCQkGTrsEZ3dw== X-Google-Smtp-Source: AA0mqf6l7J3p8utUlMy2EeOH/7sqoQpjQzUmfrDYT1JZmXK60/xJGj9L8jY7AW70sCFnZv4j4m+IbQ== X-Received: by 2002:aa7:81cb:0:b0:56b:e473:514 with SMTP id c11-20020aa781cb000000b0056be4730514mr21706832pfn.2.1670983923574; Tue, 13 Dec 2022 18:12:03 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id f74-20020a62384d000000b005772f762e43sm8516652pfa.13.2022.12.13.18.12.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Dec 2022 18:12:03 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60047: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode Message-Id: Date: Tue, 13 Dec 2022 18:12:02 -0800 To: =?utf-8?Q?Daniel_Mart=C3=ADn?= X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60047-done Cc: 60047-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Daniel Mart=C3=ADn writes: > Tags: patch > > > The attached patch makes C-M-a/C-M-e inside a C++ class definition in > c++-ts-mode go to the beginning or the end of the class, respectively. > > I've added it to the base mode because I think it's harmless for C, = and > it can be convenient if we implement an Obj-C mode based on = Tree-sitter. > > Thanks. > Applied, thanks! Yuan ------------=_1670983982-1152-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Dec 2022 20:44:43 +0000 Received: from localhost ([127.0.0.1]:34550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5C8p-0007Fx-68 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 15:44:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:44652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5C8o-0007Fr-6w for submit@debbugs.gnu.org; Tue, 13 Dec 2022 15:44:42 -0500 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 1p5C8m-0000Z1-6Z for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 15:44:41 -0500 Received: from sonic305-21.consmr.mail.ir2.yahoo.com ([77.238.177.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5C8i-0003y4-KG for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 15:44:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1670964272; bh=D+vBkhcReoAyhXa4YpSFiNor/0dICpi02Mf9+HpV0as=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=WJBSlZITGRboM7FdMZKIFgfQW3Fm96Ds4EiKbbsUFQEZg+I810RPS2lF680jBZB8tW3kmrSVk4LVM2fNmsLMmglA6E5zidLKmvtmcmYmEeaPgLytK260g8R11VCXzwLixUPdKFTWu8q8flRkqO+TrUMy/lmkELiPNTKrWIHdKVtCoKb3M6OgSPevdZLg2jSa5NXrqt55PWjfNM6s37jIpr7yYwfwtRCWjKQaSI0ceNlZP6q+KJxtFqeZ2OpTB00rMAXVlE5FiBuoPIhgxA+yZmUGjZuVJFRbaclIt+vSOpw76/Uxk15nWwDn7i6c/zwA8Tn8ckCrPxfn9+XElXWllw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670964272; bh=1Hgd0RCBhVZM8SvEjPhnbeNfSOjyAYhtPEyYSWyzX4p=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=KecfuGXrwg26WDzdKNwAlGWmu65mLKJHKpk9y0XX80dBR2VyqdCrsNXFqJ9lthdmU5q6uPZelLZ4cc/mZEoLrM4NFOU8bUgBhX0fuahNia40LGmKpkbsj8fiMdQiLeMYBuJ6ODIXQW7pt2R9EPVMpo0hloutF00jqstiz9e6rGAGe0eRDbNrMLIjeCUyzkbx0H9MmU48xf6X+SoCXczMKVVaZmwk2rc6Zo3ZRvsismV4XYyXxLkP/Gya/TfsKTuN9DOrt6Eg1t4NLtaxtFl5EGP3lA3NVYbgnr3XIwLgIQNneMSARHUu4ILr3GXzUK0Ca9ha9K9OwTrQkClXPX8THw== X-YMail-O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QvQ0bONJOONNTH4iPNnISFEj4I15m2ltCJz8gs D_uccOjcavypYjlizCiNKiC5qYOPPHVBACrrzWUyS9bt2xpX70VJv2muV5HjVyWXNZrtNbckXnKC InvxT9krZHZzMkNCfpOM_ X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Tue, 13 Dec 2022 20:44:32 +0000 Received: by hermes--production-ir2-5795fc58c8-kh698 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b142cd5de79f8a7c6e5f368e096a628d; Tue, 13 Dec 2022 20:44:29 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode Date: Tue, 13 Dec 2022 21:44:28 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" References: X-Mailer: WebService/1.1.20926 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 1555 Received-SPF: pass client-ip=77.238.177.83; envelope-from=mardani29@yahoo.es; helo=sonic305-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch The attached patch makes C-M-a/C-M-e inside a C++ class definition in c++-ts-mode go to the beginning or the end of the class, respectively. I've added it to the base mode because I think it's harmless for C, and it can be convenient if we implement an Obj-C mode based on Tree-sitter. Thanks. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Treat-C-classes-as-defuns-in-C-Tree-sitter-mode.patch >From 008ce6794281fd606df8161af5ed65b267be0664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Tue, 13 Dec 2022 21:35:40 +0100 Subject: [PATCH] Treat C++ classes as defuns in C Tree-sitter mode * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier" as a node of type "defun". --- lisp/progmodes/c-ts-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 0d0a14e933..8407be3b6b 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -553,7 +553,8 @@ c-ts-base-mode "type_definition" "struct_specifier" "enum_specifier" - "union_specifier"))) + "union_specifier" + "class_specifier"))) ;; Nodes like struct/enum/union_specifier can appear in ;; function_definitions, so we need to find the top-level node. -- 2.34.1 --=-=-=-- ------------=_1670983982-1152-1--