From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: treesit indentation "blinking" Date: Thu, 30 Mar 2023 12:05:35 +0100 Message-ID: <87mt3uwlc0.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> 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="10108"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dgutov@yandex.ru, dancol@dancol.org, casouri@gmail.com, emacs-devel@gnu.org, theo@thornhill.no, geza.herman@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 30 13:05:15 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 1phq5i-0002L3-7k for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Mar 2023 13:05:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phq5L-0001aK-Uu; Thu, 30 Mar 2023 07:04:52 -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 1phq4p-0001Oz-Dt for emacs-devel@gnu.org; Thu, 30 Mar 2023 07:04:29 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phq4j-0002Ad-R1; Thu, 30 Mar 2023 07:04:16 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id t17-20020a05600c451100b003edc906aeeaso3100820wmo.1; Thu, 30 Mar 2023 04:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680174219; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xXcymqRhKHywsbFwyunB2EZ/lylwc/gGwet04JHe1TY=; b=OuBDF6I8huLwj7J78prrSqgZvU9X2tobELPCYnAzHRJ1HfiowW7z7KjD9hdP0x/c1U HnrfI5JeDb6trc2QAfPaZjfl1GERfG8sCQe2ZJhxqoZ3B6nq2TB+8lrkfLJ/7jRF3NzQ 9hYm2mXhVavLPJRMZldu3efL5lOZb1kJFQpjEz7A1tfuOfgOtzqkvRuVkM2tl5RNs0fT Zna/PRq7uy98aZjGDN9jI6SnO2gQ1RB89cWQEieukjDv7xIkaDq4WJ36G8I/GbzF1K1l Y9YNnL5BP0IQGJGBZPjVM/scFw2899AyQIzCG88VzvKHbVc3RfJjmbTJO10JzycqQOpd wxZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680174219; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xXcymqRhKHywsbFwyunB2EZ/lylwc/gGwet04JHe1TY=; b=VZQKaOYg1RypY6v33/ifedH7Zpp3Sd22e/AlnjKYBMsE+ClGqSocZp38y4C1EX3JnM EMDkpDH6sUF/e05hlVrn+SvFIIhpZXR6DR3jCQKFMQ2tAY7J1DcFRBSGr5qIUHDYuy8h qMAyno1URoDp0Jv1Xs83Ep0kNwtNw0tHHJLtv4yU5dR2iEbvcbV4FXpJUuxdHZcJwhXb Lc/PTy3FLRCv/+kpiunkHD0TGWHg8ve9p8FQA0oqXr8cVh4+Ej7SgeT3YJ5nc8vnGpEl xjDE+5EBslKsrz4JiW28KxATalPc03ky5gyjmpAuMk/QcfebgEcb6PnEO/AjpciyMK6G Qm1Q== X-Gm-Message-State: AO0yUKWCqWPaPY8cBv5yA1wGj2yqYs89UajsSctWR6qTkUlfELEjhYYv tdFV+s4vXHvK0eHAtXQ3GzQ= X-Google-Smtp-Source: AK7set/Bd2xjY8/u/J2rl+zY2E6At7wrJL648U0uJJimKvGTOGSz/Su1uVWfXZojvygR6+Gyba0Qsw== X-Received: by 2002:a7b:c5d4:0:b0:3ed:8079:27d7 with SMTP id n20-20020a7bc5d4000000b003ed807927d7mr17017887wmk.40.1680174218592; Thu, 30 Mar 2023 04:03:38 -0700 (PDT) Original-Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id 7-20020a05600c024700b003ef5db16176sm5435064wmj.32.2023.03.30.04.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 04:03:38 -0700 (PDT) In-Reply-To: <83bkka5z7w.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Mar 2023 13:07:47 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x32b.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:304859 Archived-At: Eli Zaretskii writes: > What _is_ unfriendly is to refuse to install a change that you > yourself consider required, when asked to do that conditionally, so > users who still want the electricity, even though it "blinks", could > still have it. I think the request is reasonable, especially since > you don't use this mode, and so can easily overlook some useful > behavior that your proposed change could disable or break. You don't need me to install changes, do you? It's not like I'm refusing to fix a bug that I added: I didn't write any of this. Users that do (or don't) want electricity already have good ways to fine-tune that preference. I don't think this particular idea of your is very good, so I politely stated I'd rather not work on that possibility. If someone does, I won't object. I think that's friendly enough. >> I didn't realize that, because I use c++-mode with its electric features >> off. > > If you turn electric features off, then electric-indent-chars will > have no effect whatsoever, and all this discussion is moot. No. I use c++ mode with its bindings like c-electric-paren deactivated. I still use electric-indent-mode with its very reasonable default value for of (?\n) >> I think within 5 minutes of editing, someone used to c++-mode -- even >> with its default electricity -- will start to feel unconfortable with >> c++-ts-mode. > > We shall see, okay? You could be right or you could be wrong. The > purpose of releasing these modes in Emacs 29 is to collect user > feedback, so we know in which direction(s) to develop them further. > Your opinions are noted, but let's give others chance to voice theirs, > okay? I find this suggestion that I'm somehow shooshing other's opinions. So far I don't think anyone here has said they _like_ the bouncing. But maybe someone does.. I wasn't even the first to report this. Daniel did in this list and Geza Herman did in #61412. > The above message as part of bug#62412 clearly says "Let's assume you > turn off electric-indent-mode." I interpreted that as meaning that > electric-indent-mode is to be turned off for the rest of the examples > to do what you mean them to do. I see, my bad. Should have written electric-pair-mode instead. >> I already gave this alternative MRE of bouncing behaviour. >>=20 >> emacs -Q `mktemp`.cpp -f c++-ts-mode=20=20 >>=20 >> i n t SPC m a i n ( ) { RET for ( ; ; ) SPC b l a ( ) ;=20=20 >>=20 >> Can you reproduce this bouncing? > > No, I cannot. All I see is that the semi-colon after "foo()" indents > the line, just once, so that it has the correct indentation > (previously it had no indentation at all). We have different ideas of bouncing. >> Now try the same with c++-mode. Do you confirm that it doesn't >> bounce? > > The only difference I see is that c++-mode indents the line with "for" > right from the start, after I type RET. Which is better indeed, but > what c++-ts-mode does is not a catastrophe, either. Never said it's a "catastrophe". Just annoying/jarring/suprising behaviour that you don't get with vanilla c++-mode or modes based on cc-mode. I think that electric-indent-chars was designed with those modes in mind. >> Also in c++-ts-mode, add a closing `}`. See the "mismatched >> parenthesis"? > > No, I don't. > Are you using Emacs 29 or Emacs 30? I'm using the former. I'm using the latest master (560c27a3) and starting it with=20 src/emacs -Q `mktemp`.cpp -f c++-ts-mode > Also, which version of the tree-sitter C++ grammar library do you have > installed? I don't know how to answer that. I used M-x treesit-install-language-grammar RET "cpp" and accepted the default in all prompts. I presume it installs the latest version of the Git repo. I've just reinstalled today. I have ~/.emacs.d/tree-sitter/libtree-sitter-cpp.so I don't think it stores the version number there. >> Now I'm going to give another example. In the same file, go back to >> c++-ts-mode. Say you spotted a mistake and dont want an infloop after >> all. Go and delete the two ';;' in the for expressions, leaving, say >> just the parenthesis. Start typing another set of expressions. > > Please state exactly what to type, otherwise we will again be talking > past each other. You can _see_ in the GIF what I type. I've just using normal keys for self-insert. Then C-p, and some C-f to position my cursor before the ';;', then C-d to delete the two ';;'. And then add them back again with two ';;'. After the first ';' the line goes back, then the second one, and the line goes forward ';'. Just confirmed it happens in Emacs 29 too, commit d2e82817a3f341e426c220e98048e1784d1e3076. Also see the original recipe of bug#62142, which is quite easy to follow, for more bouncing. Can't you reproduce this either? Jo=C3=A3o