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#62412: 29.0.60; strange c++ indentation behavior with tree sitter Date: Sat, 25 Mar 2023 11:19:36 +0100 Message-ID: <953E007D-D40A-45CD-B7EE-DF9FE4A869B3@thornhill.no> References: <2496F2A0-3EB1-4CD2-B299-E1DC41B7C23B@gmail.com> <46A6C705-97DA-4D17-999B-0536F01EFCA7@thornhill.no> 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="6487"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 62412@debbugs.gnu.org, geza.herman@gmail.com To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 12:54:09 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 1pg2TI-0001LZ-PI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 12:54:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg2TD-0008A3-UI; Sat, 25 Mar 2023 07:54:03 -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 1pg2TC-00088k-1h for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 07:54: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 1pg2TB-0007ye-Pw for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 07:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg2TB-0003wc-Kh for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 07:54:01 -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, 25 Mar 2023 11:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62412 X-GNU-PR-Package: emacs Original-Received: via spool by 62412-submit@debbugs.gnu.org id=B62412.167974520715106 (code B ref 62412); Sat, 25 Mar 2023 11:54:01 +0000 Original-Received: (at 62412) by debbugs.gnu.org; 25 Mar 2023 11:53:27 +0000 Original-Received: from localhost ([127.0.0.1]:41897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg2Sc-0003vT-RD for submit@debbugs.gnu.org; Sat, 25 Mar 2023 07:53:27 -0400 Original-Received: from out-17.mta0.migadu.com ([91.218.175.17]:62284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg2SZ-0003v2-Kh for 62412@debbugs.gnu.org; Sat, 25 Mar 2023 07:53:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1679739578; 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=lBR/5b+pG0shhhvStOyR9y6GMZkVv5RPi89P/zxidr4=; b=08l9pLXiTJLWHnqZ89mRpDx4H5XnY1hdt3OYmRwe9/ISCx9a3dA7QSZAYCTwMMgwNvKVpy LaK25pjDBgeRFwtZ7TMyHJpP1QX5f7EQ1PjIJsbANe+I5YqZOxQ6Ei8q2cbx9kbetaQvRD kbHO3tzNFs3bQFZpUs8yQsFiUch0XVRX6nH8J/hZpGj6AWS5whnXYBoA29E9sCvr49ARg5 c8oF1fx3S85tzAZxJP0tWrPobnFsRZ8FKlWTBTyIW/Vo2RP1DvTyMnvshATwUqWJw/Bu5s mrMl17BDosmbbIKOfLD4s8sxPxjfORsAFGK+ktyf1uux8Y7TP/MH+bJvEJFTTg== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: 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:258540 Archived-At: On 25 March 2023 09:53:31 CET, "Jo=C3=A3o T=C3=A1vora" wrote: >On Fri, Mar 24, 2023 at 10:02=E2=80=AFPM Theodor Thornhill via Bug report= s for >GNU Emacs, the Swiss army knife of text editors > wrote: >e about the original purpose for this rule, CC=E2=80=99ing Theo=2E >> > >> >Yuan >> I'll look more deeply into the cause of this, but the rule is covering = some preproc directives iirc=2E >> >> Unfortunately tree-sitter behaves better when auto pairs is used=2E I w= ould advise people to use electric-pairs-mode (if that's the correct name, = on mobile now) to avoid these sorts of issues=2E > >electric-pair-mode, it's not on by default=2E > >But, for some reason, electric-indent-mode _is_ on by default, >at least in c++-ts-mode=2E > >So this has nothing to do with tree-sitter IMO, it's just >electric-pair-mode doing its thing=2E > >Why is it on by default? A fair number of users don't like >this electricity, or prefer to have it toned down=2E At least >this has been the argument for not turning on electric-pair-mode >by default, which is a much less jarring mode IMO, and one which >would solve these problems=2E > >Jo=C3=A3o Yeah, maybe! But I was under the impression that indentation was electric = by default in most modes, but I may be mistaken=2E The reason I mentioned electric-pair-mode is that the parser fails less of= ten when the closing paren or bracket is inserted, as it is much simpler to= have a functional ast=2E