GNU bug report logs - #70272
30.0.50; Refactor c-ts-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Yuan Fu <casouri@HIDDEN>; dated Mon, 8 Apr 2024 07:19:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70272 <at> debbugs.gnu.org:


Received: (at 70272) by debbugs.gnu.org; 1 Mar 2025 02:52:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 28 21:52:59 2025
Received: from localhost ([127.0.0.1]:56634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1toCyJ-0007Pg-8m
	for submit <at> debbugs.gnu.org; Fri, 28 Feb 2025 21:52:59 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:52664)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1toCyH-0007Ot-8s
 for 70272 <at> debbugs.gnu.org; Fri, 28 Feb 2025 21:52:58 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5ded6c31344so3437915a12.1
 for <70272 <at> debbugs.gnu.org>; Fri, 28 Feb 2025 18:52:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740797571; x=1741402371; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=jR/N/eO+JEdmxU0b/YNVEH3HyyKiW6l3JTPkYQUqs8g=;
 b=SNymKrZ77CO+19KlQJlSs7QSQzpbzZ+VlYe56rlKXPaIgVAJR1aTVJLZL2CLrpZzJK
 E2Abng3piAGOLk0OLYPmsoRBfd+P4kFQ7LibzL16oHLmNNR+l4y37b/pp9mcFHV/vpD+
 w3P+31CMCV/9+k8p1NEGbUI3hrqCtvc7SYmX4j2Tp1ubOjZS8S95fh7L79Zh+7LwAtwZ
 3Z+ZRGtNShqjQVlwaeGJgtposBsSFnJx7f5FZbG8aIzPEsKlfBDb+vipZ2K8IPog1inx
 EUeb4aG60M1uN6Cr2/7HVZdslyP7UDlWBpyzM2MOcBM7AJjkR0wprHi59gouUKazB8PX
 zx2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740797571; x=1741402371;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=jR/N/eO+JEdmxU0b/YNVEH3HyyKiW6l3JTPkYQUqs8g=;
 b=aM+1n61dYwKv9UwJ9k4M8zLUheaKxTs/9KJM93ICRGk5SvB45V6vpkRBHlHaS4Jk0J
 4obIHaZFciREZJQ4AXfBWTE19fSKExe9WBGy5qzBmTNgW1EjwERKfdIpxgHi8pfxhI91
 mR34VbTfN3Um2KPBM/0c7J756tPHsY8FQVVkRS2rLOXvu0sm4vPch6NklT5njvu1LQgw
 FKD23ZMK7pvl/SYTxSzT1HqZr5HUhhk7RXPu+NgxjdREv9T9AXjVXD/22gDXBGjzlTdm
 AGoBn5NCmg9qcL+Xb9wTgzcdDesx9GaM8thS4nW2XGJAZ/kUf5+/UChUObfIQ0eYmt2H
 KguA==
X-Gm-Message-State: AOJu0YzMnmK1n481kPVeRik2JklVUkLwCvcXHtuR1O6AksPethHuocUO
 0D0wH8Tqv816YR8GWQxWqs+S2ONlbFMqFujKYcCnuOKT5xyoMENktS7we5uuJV7uri8IXdVPC8n
 DGETtwgqeXHWACNfkIKKHuvj/pwWgeissy9o=
X-Gm-Gg: ASbGncuIOQ0MNEDSZ2dggYhwIUXLjGq9H4ePsUUc9gpwI1UasDQSjatNtH0O4K7wf39
 QpJc21IDgFLJuaPLv2WIQW+9qL1GBmbhF+Lc1dCImDz3sECbD+vcdgyeDybWtAh2HjPcCTF4Utf
 /ADuh0SmHnRGlk4r4Bqv03QDbJWgs=
X-Google-Smtp-Source: AGHT+IExcToJsxJ65okUpYkJiH7zdKNZNwPrrxjGhkR65AQzJtHwJB/sAtRC34hWbnM/mF6/Wo+AQBNN2k+v8Ptrhp0=
X-Received: by 2002:a05:6402:40cf:b0:5e4:d220:3333 with SMTP id
 4fb4d7f45d1cf-5e4d6ac4a4dmr12215448a12.1.1740797570990; Fri, 28 Feb 2025
 18:52:50 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Fri, 28 Feb 2025 18:52:35 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <DBAE3734-BFEF-454E-B019-0B0617F0E60E@HIDDEN>
References: <DBAE3734-BFEF-454E-B019-0B0617F0E60E@HIDDEN>
MIME-Version: 1.0
Date: Fri, 28 Feb 2025 18:52:35 -0800
X-Gm-Features: AQ5f1JppWMviVs23_DLADiQnvzhOTZxDSDImhEsEpe9QVKFdT0oi61S4ygU7zi8
Message-ID: <CADwFkmkheRqqVqOCGXyr4s69VT9d1rtB=54g6CEFOF7WhYNOcQ@HIDDEN>
Subject: Re: bug#70272: 30.0.50; Refactor c-ts-mode
To: Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70272
Cc: eliz@HIDDEN, 70272 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Yuan Fu <casouri@HIDDEN> writes:

> X-Debbugs-CC: eliz@HIDDEN <mailto:eliz@HIDDEN>
>
> Eli, I=E2=80=99m finding c-ts-mode to get uglier and heavier in an unfort=
unate rate. Of
> course, I=E2=80=99m basically the defector maintainer now and the main pe=
rson to blame
> for much of the complexity. We needed to add a lot of code and even hacks=
 to
> make c-ts-mode work for complex C code.
>
> A complicated and sometimes hacky c-ts-mode.el is bad for maintainability=
, and
> sometimes make c-ts-mode slow and unpleasant to use. More over, I feel th=
at some
> people will look at c-ts-mode when looking for an example for writing a
> tree-sitter major mode. And c-ts-mode in its current state is not very su=
itable
> as an example.
>
> Since a lot of the complexity are only needed by complex C code. I wonder=
 if we
> can separate c-ts-mode.el into a simpler version that works for =E2=80=9C=
modern=E2=80=9D C and
> C++, plus an extra file that contains the additional things that makes it=
 work
> for complex C code?

I'm also lacking some detail here: what exactly is considered "complex C
code"?  Why is it better if we move things to a separate mode?  We still
have to maintain it, right?

If we want to make any such changes, I think the idea should be
discussed on emacs-devel.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70272; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Apr 2024 07:18:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 08 03:18:25 2024
Received: from localhost ([127.0.0.1]:45196 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rtjGq-0006bS-Kn
	for submit <at> debbugs.gnu.org; Mon, 08 Apr 2024 03:18:25 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37536)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rtjGo-0006bE-Oc
 for submit <at> debbugs.gnu.org; Mon, 08 Apr 2024 03:18:23 -0400
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 <casouri@HIDDEN>) id 1rtjGb-0001KL-OS
 for bug-gnu-emacs@HIDDEN; Mon, 08 Apr 2024 03:18:09 -0400
Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <casouri@HIDDEN>) id 1rtjGa-0007iI-6L
 for bug-gnu-emacs@HIDDEN; Mon, 08 Apr 2024 03:18:09 -0400
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-1e4266673bbso5089835ad.2
 for <bug-gnu-emacs@HIDDEN>; Mon, 08 Apr 2024 00:18:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1712560686; x=1713165486; darn=gnu.org;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=ZNM2g8pEoWpr/d0PKM+xnM66JMPA7U789sv78v3i0ww=;
 b=jRV+b3hgCvC+fnqe7dXlu1mL7dA+UD4MNMoelf0mkbxMnqMfOKCTHqb0qZt04ibKWP
 9jKoDOW9PyPo2UqFFlsKaNK3C7K1zjNfqVDEcpyHXqvc8cok7xA2kB48ChCxGqi6EEaO
 IdSNfoJA0xQQ9iZmLxn/ULcfsJKq1gsY1ptSvbEcAm6ymLt5gtfJzCSQSm6oAFP8fnOU
 4a+9yED+XeM098P54WamZbSWKl+Nv2tZ/CCtjzmmkMlXlt5CxzZ02rlX0QBXXYUlJXrJ
 E8KscFObhxrNcYZCw6My6KuaB45eu+r7ZpZgRf7HoHq2le1z3yE11nHeC8zpx2EI3vSM
 RLOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1712560686; x=1713165486;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ZNM2g8pEoWpr/d0PKM+xnM66JMPA7U789sv78v3i0ww=;
 b=NdfIZTTGKZJMo/cyBkC+p2oDfPnz76AgZlLroOMmoQXH+hALy1+wg0ee3WyDYFZfNK
 sBGl/FlzMcGxyZ9La52L+tkoAWax2eeYvwGCCQSugpyLjJsmxnb4lwBqc1yiV+PeR1Zn
 Or032O+30dQ4EHA7YjOSZtUO8g3YRV+jjlWIu4IHJwG1siurSsm86d61MyEa3K0ilkYT
 eE7dH+08tEFUN7ycBiU/ORSwiVJTr+5vbAdM4dY9uklj8PoDhZfDCe9hK7xpbAjYogu0
 UzJC97sZlsryWfJltmXoN5/KfzA6wMpNhW+iOnhxbTXYXpSNk7BiQCjJlQhm4AAGe/gL
 h/Bw==
X-Gm-Message-State: AOJu0YzX2ndgcow2wpC0puUWzKD/yWLIsI5zuvtNrfQza+/wFhtQoNmV
 16iQPI7phdev+OZEE19cmBch1e6g1T5JJzBEL4DActkjdNf/Vo/qpJ/lH/FY
X-Google-Smtp-Source: AGHT+IEAhRU8KJ/SyesdQdZcyH60bui4BBt3xrfAD4P1vRGfazvBzZgvOPw+P5FsVAqQ4kT3G00TWQ==
X-Received: by 2002:a17:903:110c:b0:1e2:7e04:3ab1 with SMTP id
 n12-20020a170903110c00b001e27e043ab1mr8195859plh.33.1712560686125; 
 Mon, 08 Apr 2024 00:18:06 -0700 (PDT)
Received: from smtpclient.apple ([2601:641:300:4910:6c00:57e9:a6fc:238b])
 by smtp.gmail.com with ESMTPSA id
 c5-20020a170902c1c500b001e2a4663179sm6212106plc.258.2024.04.08.00.18.05
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 08 Apr 2024 00:18:05 -0700 (PDT)
From: Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: 30.0.50; Refactor c-ts-mode
Message-Id: <DBAE3734-BFEF-454E-B019-0B0617F0E60E@HIDDEN>
Date: Mon, 8 Apr 2024 00:17:54 -0700
To: Bug Report Emacs <bug-gnu-emacs@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
Received-SPF: pass client-ip=2607:f8b0:4864:20::631;
 envelope-from=casouri@HIDDEN; helo=mail-pl1-x631.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

X-Debbugs-CC: eliz@HIDDEN <mailto:eliz@HIDDEN>

Eli, I=E2=80=99m finding c-ts-mode to get uglier and heavier in an =
unfortunate rate. Of course, I=E2=80=99m basically the defector =
maintainer now and the main person to blame for much of the complexity. =
We needed to add a lot of code and even hacks to make c-ts-mode work for =
complex C code.

A complicated and sometimes hacky c-ts-mode.el is bad for =
maintainability, and sometimes make c-ts-mode slow and unpleasant to =
use. More over, I feel that some people will look at c-ts-mode when =
looking for an example for writing a tree-sitter major mode. And =
c-ts-mode in its current state is not very suitable as an example.

Since a lot of the complexity are only needed by complex C code. I =
wonder if we can separate c-ts-mode.el into a simpler version that works =
for =E2=80=9Cmodern=E2=80=9D C and C++, plus an extra file that contains =
the additional things that makes it work for complex C code?

Yuan




Acknowledgement sent to Yuan Fu <casouri@HIDDEN>:
New bug report received and forwarded. Copy sent to mailto:eliz@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to mailto:eliz@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#70272; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 1 Mar 2025 03:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.