From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Newsgroups: gmane.emacs.bugs Subject: bug#62412: 29.0.60; strange c++ indentation behavior with tree sitter Date: Sun, 26 Mar 2023 15:54:09 +0200 Message-ID: <73f1483b-a450-7e8a-d565-665fae62a0a1@gmail.com> References: <2496F2A0-3EB1-4CD2-B299-E1DC41B7C23B@gmail.com> <46A6C705-97DA-4D17-999B-0536F01EFCA7@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37390"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Cc: Yuan Fu , Theodor Thornhill , 62412@debbugs.gnu.org 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 Sun Mar 26 15:55:12 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 1pgQpz-0009SM-L3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Mar 2023 15:55:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgQpr-0003Xx-9r; Sun, 26 Mar 2023 09:55: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 1pgQpq-0003Xn-FV for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 09:55: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 1pgQpq-0002ic-4i for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 09:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgQpp-0003sj-PX for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 09:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Mar 2023 13:55: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.167983885914849 (code B ref 62412); Sun, 26 Mar 2023 13:55:01 +0000 Original-Received: (at 62412) by debbugs.gnu.org; 26 Mar 2023 13:54:19 +0000 Original-Received: from localhost ([127.0.0.1]:44312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgQp8-0003rR-Qu for submit@debbugs.gnu.org; Sun, 26 Mar 2023 09:54:19 -0400 Original-Received: from mail-ed1-f41.google.com ([209.85.208.41]:36385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgQp7-0003rF-5i for 62412@debbugs.gnu.org; Sun, 26 Mar 2023 09:54:17 -0400 Original-Received: by mail-ed1-f41.google.com with SMTP id w9so25611546edc.3 for <62412@debbugs.gnu.org>; Sun, 26 Mar 2023 06:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679838851; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EWyRS3+j1owghA6kpyPweOAk8wBXhAhBv34eeqOirIo=; b=Zl1K7b/qD65KtHHxinx/lFl+Q4z5yrtqTqQCovDTo9x8J6b4anFF+m58DIFIFEauAP dfMCGLglf3Tj9a+uyIpWR14zes1cb19OVsENja2T0+a0kn8Hq3w44UFwOLCb6qCwL/4b rtNVP5IA+Cu12Pi25qBvwua+MPJnit/Cem4lJGii2f7gRtgBKZDP2mnEl6FWGCne4Q0f YniUng/L/NCwB3IAC/O9oNArfenvKWzyX6d0KtexhIb2nilQYRgPatxtcnW/Qf6E0IjG VmZMr1LOtcdvsyJFNEfk3YuHaDPufy3MZAN6jP3r1pM689qSih5i3AXh9sqozMfoUnau OY0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679838851; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EWyRS3+j1owghA6kpyPweOAk8wBXhAhBv34eeqOirIo=; b=waanU3sAyeKyAl/bOsALOI51X8JOzYbn1aFR/XTbmFCNbROVmq+9vZBnctcW8Aybqz uYh951E1EaTZjhBmJe19t9rcGEdctmJv28lNlh32XYYR9MA02XpFaqkCp6rPj3Jw5t8T tCEfdJVmEldSv/Or/7j651M/7VfuT3mxkhwTRRLOtXy6HXZwIimiI5Ux+4xwJdjbgOWX LU65jr9VVxZvK+tK89FVn9DvE1x65TcIIGgfpoJPgBJAuJWog0OpfvmdDA1Ej5l5wLCF 46F7IdATW1LqUmBjsKbBhPi4WjJA4N5tUzZJagCM3wVqFwXg/mEih4GLyBBEi9OpUa0I AwRg== X-Gm-Message-State: AAQBX9f70yfky1CDd7wtVYcH+prS6bfQRYs2naPmntUWweCU6523+BR7 seUym4/xIzl/ayJ7DMScU38= X-Google-Smtp-Source: AKy350ayj1HZkRFZJIu0nR6Vbfo7qDfGk2NBwaU/IHkHRflY4wcWyB9wUoUEEb1X/rY+SFX/awHssw== X-Received: by 2002:a17:906:7189:b0:930:6591:15ee with SMTP id h9-20020a170906718900b00930659115eemr10166752ejk.10.1679838851182; Sun, 26 Mar 2023 06:54:11 -0700 (PDT) Original-Received: from [192.168.8.4] (netacc-gpn-204-88-167.pool.yettel.hu. [5.204.88.167]) by smtp.gmail.com with ESMTPSA id n25-20020a1709061d1900b008e9c79ff14csm13099857ejh.96.2023.03.26.06.54.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Mar 2023 06:54:10 -0700 (PDT) Content-Language: sv-FI In-Reply-To: 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:258681 Archived-At: On 3/25/23 12:43, João Távora wrote: > Let's assume you turn off electric-indent-mode. In c++-mode, pressing RET > after: > > int main() { > > "correctly" indents the next line. In c++-ts-mode, it doesn't. > > Both programs are ill-formed but you're right that after correcting > that, by say adding 'return 0; RET }', the c++-mode version of the > same program is closer to being correctly indented. I'd say that the current c++-ts-mode behavior is very bad for this example. If you type this into an empty buffer: int main() { and press RET, the new line won't get indented. But the case is worse, because TAB doesn't work either (doesn't do anything). Supposedly because tree sitter has the wrong idea of the indentation: if add indentation by using spaces, pressing TAB deletes the spaces. (Note: it doesn't matter whether electric-indent-mode is turned on or off, same thing happens).