From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62238: 30.0.50; Unusual interpretation of "S-expressions" in c-ts-mode Date: Sat, 18 Mar 2023 14:41:57 +0100 Message-ID: <326C7C12-5A17-473D-88C8-7C6F7B75AE52@thornhill.no> References: <87ilezg0wo.fsf@posteo.net> <7FDC4392-AC34-4EA2-A166-AB10755361CD@gmail.com> <83jzzeb2v6.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 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="14452"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62238@debbugs.gnu.org, casouri@gmail.com, philipk@posteo.net To: Eli Zaretskii , Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 18 14:43:15 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 1pdWq2-0003W8-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Mar 2023 14:43:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdWps-0000j3-AM; Sat, 18 Mar 2023 09:43:04 -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 1pdWpq-0000it-P3 for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 09:43:02 -0400 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 1pdWpq-0004yB-Gy for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 09:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdWpq-0003kZ-8N for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 09:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2023 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62238 X-GNU-PR-Package: emacs Original-Received: via spool by 62238-submit@debbugs.gnu.org id=B62238.167914692314332 (code B ref 62238); Sat, 18 Mar 2023 13:43:02 +0000 Original-Received: (at 62238) by debbugs.gnu.org; 18 Mar 2023 13:42:03 +0000 Original-Received: from localhost ([127.0.0.1]:46677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdWos-0003j6-R1 for submit@debbugs.gnu.org; Sat, 18 Mar 2023 09:42:03 -0400 Original-Received: from out-51.mta0.migadu.com ([91.218.175.51]:24504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdWoq-0003ig-KP for 62238@debbugs.gnu.org; Sat, 18 Mar 2023 09:42:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1679146919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6OgW93C0Yy1AHFaWEFGJhsXuWj8dZbtB0Qrv0HH8gkk=; b=v9u8eyyOwVRy642pqYp3D/5XVDNJSKlTErJHaYuC87cbcEwAN4N/rakCGdnPS3yViECPXc r+YAgQxNmLxPEC+/MuWDbafCIP0DEamEU19UVLCrBWAZ+jEQXBq4jqXkFKbdWHetMtPwp3 40iOfzWr9X5pw9c5nn3mSbem2ljlozuiv4UxfrxXtgw/OtV87TFOsJ5ZY6b0FlcnWF1vhm QjmsDVCO0WM+couS4Vp9B4GlBWQzAdaUQOtMJ6eHrHMRFRqtvgWLSmHhT8NczByBGC8/Ce iOgjXzyiadhXNX32/sOsnT0cH8kewcVt30iQoEZjhA0uPLLiK0B+mtvPFgj49A== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <83jzzeb2v6.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:258177 Archived-At: On 18 March 2023 14:33:49 CET, Eli Zaretskii wrote: >> Cc: 62238@debbugs=2Egnu=2Eorg, Philip Kaludercic = , >> theodor thornhill >> Date: Sat, 18 Mar 2023 13:11:15 +0100 >> From: Daniel Mart=C3=ADn via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >> > You need to enable c-ts-mode first, which redirects >> > forward-sexp-function to treesit-forward-sexp=2E >>=20 >> I see in treesit=2Eel that we set forward-sexp-function to >> treesit-forward-sexp when treesit-sexp-type-regexp is set by the major >> mode=2E For languages with simple grammars, like C, I think that the >> current approach that uses the syntax table is simpler and less prone t= o >> errors, because the Tree-sitter function is general and should work for >> every language=2E I'd suggest we don't define treesit-sexp-type-regexp= in >> c-ts-mode, at least for C=2E > >I don't understand how you came to that conclusion=2E Why would we want >to use syntax tables when we have a parser at our fingertips? And if >"the Tree-sitter function is general and should work for every >language", as you say (and I agree), why should we refrain from using >it for C? > >> For languages like TypeScript, whose grammar is more complex, perhaps >> forward-sexp does not work very well and using Tree-sitter to implement >> it gives better results with code that is simpler to understand=2E > >There's a huge advantage of using the same function for all the >supported languages, because that makes that function better, as it is >tested in many different situations=2E > >So I don't think I agree with you here, not at all=2E Yeah but I need some more time, or at least some patches to look at :) Theo