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 15:43:49 +0100 Message-ID: <87bkkawb8a.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> <87mt3uwlc0.fsf@gmail.com> <83wn2y49v9.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="40587"; 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 16:42:49 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 1phtUG-000ALb-Lb for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Mar 2023 16:42:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phtTO-0000FU-N4; Thu, 30 Mar 2023 10:41:55 -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 1phtTM-0000E8-Et for emacs-devel@gnu.org; Thu, 30 Mar 2023 10:41:52 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phtTK-0005rV-Lz; Thu, 30 Mar 2023 10:41:52 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id e18so19337826wra.9; Thu, 30 Mar 2023 07:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680187309; 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=pj2VtuFHtcPSvkxFUmUogyyI9T08OR+ajf5o8Eqrxow=; b=WnCd2lbmtoumK+I0G5Chop/j2ZyTBItBABnkPlC2HcOeB4B0aLIyXs99ixxu/sjFaU qyC76wGbu+eXGrvEhBsS3NC+6gNzU75JRP61KUN6fmQkqtTIC63p00A3PcmSGWZ9ohZP iBuNB2GDKQ21eeO+q83lj1bMZTjXXWtQQjTHlYzrDhQ9IYidCKo553I5a9ADwm8NraMU czCh8RaihEgcBJ200t2siceP/4hTBpzJzbVilRxtn/Mfq1AhGgDP70pUKYReumLWb/s5 uehKYTSYckttV/5KzpJ17vQRWB1EuJHQplcjCOALtHMjEwE8waIZ8YEEqGR6Xu1n6Cy7 CnWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680187309; 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=pj2VtuFHtcPSvkxFUmUogyyI9T08OR+ajf5o8Eqrxow=; b=z8zCLMduoj78Ok47qXrvaj6QnnjDBdEX75ni7Yuub3uDOrlIVcon5VZhv5dvW7rrbA DiZAZStCTdXYY2YRF6DMbEEVI+iP7wzPsCWwlk2U3340ttWZVLZG52a8J/XW69fOPC3E EOCfw4XLcz11TlCcAoMxB5qVlU3RNME+d/zOInG4asdOZgfUaF1CKbj5LkpKyUsohpEh J5aMYh0X464Y/WbqzGvxJd1PdB3OLtCGPfbc3g4rfRmo9gsDGtulkujXCEk8nN9bS5cL pBFSnOeHTENMTDxBzZRvy4ZyS10sD2mLtDUhfuzbeAt8tST4XaUJJgWyN5kO5Gio1som 0KkQ== X-Gm-Message-State: AAQBX9fj5GF5k++gyrpR3vChShX7yyttS0eAbjiN3lEf5zronqgnFEiH jKRqXCJAk3oAbFQH1I7FOyU= X-Google-Smtp-Source: AKy350YRwbYp8ZTz6YDPloae9axJfCpu1fi7TV/SGWvWFRXsbhy0pJX/23NZQxf/IYCvdZCHNmZ2/A== X-Received: by 2002:adf:f8c2:0:b0:2c3:e7d8:245c with SMTP id f2-20020adff8c2000000b002c3e7d8245cmr17446996wrq.13.1680187308539; Thu, 30 Mar 2023 07:41:48 -0700 (PDT) Original-Received: from krug (87-196-72-128.net.novis.pt. [87.196.72.128]) by smtp.gmail.com with ESMTPSA id u8-20020adfdb88000000b002cff06039d7sm32952935wri.39.2023.03.30.07.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 07:41:47 -0700 (PDT) In-Reply-To: <83wn2y49v9.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Mar 2023 17:00:42 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42a.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:304868 Archived-At: Eli Zaretskii writes: > This is a community project; without active collaboration of all the > contributors it wouldn't be such a success. It should go without > saying that when someone proposes a change and the discussion then > concludes the change needs small adaptations, the person who proposed > the change will then go ahead and install those small adaptations. > Without such minimal collaboration, we as a project will get nowhere. But "the discussion" _didn't_ conclude that. You concluded that. I'm not interesting in designing a defcustom, figuring out if it should be a boolean or a string, what the default should be, the docstring, the NEWS, etc for something which I think is a bug. I've never insisted other people to modify their work in ways they aren't confident in. They would probably politely refuse it and maybe I would be slightly disappointed, but I could always do those changes myself if they are indeed easy. "Unfriendly" would be a really bizarre judgement to bestow on someone who volunteered time and code to my project and happened not to agree on a detail. > (with very few minor customizations), and so I do see the electric > reindentation in c++-mode all the time, and am used to it. If most > users don't disable the default electric behavior in CC Mode, they > will not see c++-ts-mode behavior as "jarring". Users coming from other editors like Microsoft Visual Studio will. You asked for feedback on other editors, I'm giving it to you. And there's also the fact that c++-ts-mode does _not_ behave like c++-mode w.r.t to indentation to start with. There are many indentation differences, even without the electricity part. >> But maybe someone does.. I wasn't even the first to report this. >> Daniel did in this list and Geza Herman did in #61412. > > Maybe Daniel also disables the electric behavior of CC mode? In any > case, customizing electric-indent-chars could solve Daniel's problems > as well. But why subject new users to the same strangeness? Presuming=20 >> > Also, which version of the tree-sitter C++ grammar library do you have >> > installed? >>=20 >> 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. > > Then I don't know why we don't see the same behavior. Beats me. Dmitry has reproduced it. It's not a "sometimes only" thing. Happens consistently. >> JT: And did you try the final example that I showed in the animated gi= f? >> JT:That's even more "bouncy", at least in my book. > DG: Yep, I see that.=20 My opinion is if this is a problem with the indentation rules, then we should either fix those indentation rules or turn off the electric features that rely on those temporarily broken indentation rules. As the rules get fixed, then adding the features back makes sense. The current situation is inconsistent, IMO. >> 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 ';'. > > Similar things happen with CC mode. Perhaps not in this particular > situation, but in others. If you think this indentation back and forth as you type something as innocent as two ';;' is acceptable behaviour, then fine. I though there was consensus that this was undesired in the new mode and volunteered my analysis and a fix. If there isn't such a consensus, then I'll see myself out. >> Also see the original recipe of bug#62142, which is quite easy to >> follow, for more bouncing. Can't you reproduce this either? > > I'm confused by the description there, and we just discovered that you > said there to disable electric-indent-mode when you really meant > electric-pair-mode. So maybe post a revised example there (or here), > this time without any mistakes, and let's take it from there. I didn't mean _my_ description, I meant Geza's example. Thus I wrote "original recipe" of that bug. IOW, the post that created the bug#62412. That's the one you could look intro reproducing, if you're interested. But if you really want to focus on that other particular message of mine, it is only describing the different indentation behaviour of c++-ts-mode vs c++-mode, identifying the strengths and weaknesses of each, in ways that aren't particularly critical of one vs the other. Jo=C3=A3o