From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Herman=2C_G=C3=A9za?= Newsgroups: gmane.emacs.devel Subject: Re: treesit indentation "blinking" Date: Thu, 30 Mar 2023 17:03:18 +0200 Message-ID: <87pm8qnugr.fsf@gmail.com> References: <87h6ucik61.fsf@dancol.org> <0F406D08-56D4-4B21-B94D-A47681606911@gmail.com> <1870bcadd28.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <1870cce6690.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <35A837A9-59B4-4F1F-A5FA-8483C8024D76@gmail.com> <187104f6b48.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <21d018e5-a730-12e3-f97c-fffa4f646ccf@yandex.ru> <83v8ioc2ou.fsf@gnu.org> <87sfdsx0r2.fsf@gmail.com> <87lejgsf0m.fsf@gmail.com> <83pm8s70o3.fsf@gnu.org> <83mt3u65vw.fsf@gnu.org> <87y1newqus.fsf@gmail.com> <83bkka5z7w.fsf@gnu.org> <871ql6a4d4.fsf@gmail.com> <83y1ne4avb.fsf@gnu.org> 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="4099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.0; emacs 30.0.50 Cc: geza.herman@gmail.com, joaotavora@gmail.com, dgutov@yandex.ru, dancol@dancol.org, casouri@gmail.com, theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 30 17:14:16 2023 Return-path: Envelope-to: ged-emacs-devel@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 1phtyh-0000rO-T0 for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Mar 2023 17:14:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phtxn-0000tq-Rl; Thu, 30 Mar 2023 11:13:19 -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 1phtxj-0000tL-Q1 for emacs-devel@gnu.org; Thu, 30 Mar 2023 11:13:15 -0400 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phtxg-00049G-Kv; Thu, 30 Mar 2023 11:13:14 -0400 Original-Received: by mail-wr1-x433.google.com with SMTP id y14so19461944wrq.4; Thu, 30 Mar 2023 08:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680189190; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=bYET47cq0MIz7yP97uTdYe0QSopwNfNr6NTlq9iPz/o=; b=RxF7tyAIl5/U7EXMJjw8gRtPLTKngA/mXdyO07MsRTXMd2XhFk964OkWEUQyQvyyZu viXMA++SWbSwH6crEKfUZb7zaR72QWASS2oeJecbtlDp6VJXEiAz2w1cR0KgyTHhPYQP iykH3+Xfv1mMz2jmgDxizoCMQSZjYqQPpFBy6+kwwqlyNQOcMO98B4au5ne1X6IIJMxk 8mQCfS7o/z9WJIDPKfFCCDHhwHqaJR3Uvc6cR3XtDBP5jkE8td6UpLF6JMcOI68a0mdg 8gEN0bQIMhNOTdYOyQvVrtpTFVBFIPKDqzwprVv12K/O3+ppYZbNhsPEGP/p/D+Evc+F 23eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680189190; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=bYET47cq0MIz7yP97uTdYe0QSopwNfNr6NTlq9iPz/o=; b=bqPHF+YBwyuJxdbPC4wh/r6Gtv48mu1LaB6Ly3eLuEDXypH5uQx1qSDRqJPOja4O4s LSYbf1WY8nFB6ro+2PMVESDDWiQjcEqTL7Wao2/qF8rLRc8WfVMFkLfsIVaQReW0p8Zo 8vs5I0Bgh+JG5ujuyBhPqww7fHKDhAfkQnHwEc6VFPqSydjQvHHKYgKpRbO2l8pmjqWJ Es59N1B/0A/AjKLuaNzPYLHNEh4Ozt3Bogp/YYQ7+YbcpzQ2q0BaR8EEQuk4Ad1AyDtQ Vi65VwymOD+SX4DDFxNZEgYee7fbSAx3/20BD65SO/QjvefQsnlmMtdXEMuiQxElpf1f x/7Q== X-Gm-Message-State: AAQBX9f6HNeEdlQltPx2l3ydObztr9ZJ3g4M4Bdj2OCy4grUHfLh6avn 1bTYkM0nGB5xAtcb1KM0jqqSTtvLYTuhdg== X-Google-Smtp-Source: AKy350bxnphmJjHrFNsrSxoIWsRK0Vdzu3Duv9PqyIu5s3vhvw21Al5TkPfacHpK2WlppWxA7+0Lsg== X-Received: by 2002:a05:6000:b:b0:2d8:2b0f:c3a3 with SMTP id h11-20020a056000000b00b002d82b0fc3a3mr17417656wrx.70.1680189189932; Thu, 30 Mar 2023 08:13:09 -0700 (PDT) Original-Received: from localhost (62-77-231-86.static.invitel.hu. [62.77.231.86]) by smtp.gmail.com with ESMTPSA id l7-20020a05600012c700b002e45f6ffe63sm3119249wrx.26.2023.03.30.08.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 08:13:09 -0700 (PDT) In-reply-to: <83y1ne4avb.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=geza.herman@gmail.com; helo=mail-wr1-x433.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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304872 Archived-At: Eli Zaretskii writes: >> [ examples snipped ] >> >> Can you reproduce these? These happen both with emacs-29 and >> several-day-old master with the latest tree-sitter-cpp (but it also >> happens with a ~1 month-old tree-sitter-cpp). > > Thanks for the examples, but how are they related to the issue at > hand? We are discussing the possibly adverse effects that > electric-indent-mode and the customization of electric-indent-chars by > c-ts-base-mode might have on user experience while typing C/C++ code. These are related because the root cause of the bouncing issue is that tree sitter calculates the wrong intentation during the code is being written (i.e., not complete). If this were fixed, most of the bouncing issue would go away. Not everything, of course. If a case causes bouncing with c++-mode, then it will likely bounce with c++-ts-mode as well. I wrote this in a previous email: "In my opinion, this issue has two different parts: 1. design problem which cannot be really solved. Like this "std::" thing. The editor cannot read the programmer's mind (whether they will put a second colon or not). And because c++-mode behaves the same, I don't really think this is a bug. Or at least it is just a small one. 2. tree-sitter related problem, where tree-sitter has the wrong idea of the correct indentation of a line. c++-ts-mode fails for one of the most simple thing: write "int foo() {" into an empty c++-ts-mode buffer, and press RET. You'll notice that the cursor won't be indented. Also, TAB doesn't work either. You need to manually press multiple spaces to have indentation. c++-mode doesn't have this problem. Note, I understand that calling this "ts has the wrong idea of correct indentation" may be unfair, but for a user the correct indentation is pretty clear in this situation. In my opinion this is a bug (that's why I reported #62412)." > Are you saying that removing the customization of > electric-indent-chars by c-ts-base-mode solves the problems you > mention? If not, then I think your examples should go into a separate > bug report, which should be investigated separately. No, the root cause doesn't have any relation to electric-indent-chars. G=C3=A9za