emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: treesit indentation "blinking"


From: João Távora
Subject: Re: treesit indentation "blinking"
Date: Thu, 30 Mar 2023 15:43:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> 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 

>> > 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.
>
> 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 gif?
  >> JT:That's even more "bouncy", at least in my book.
  > DG: Yep, I see that. 

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ão



reply via email to

[Prev in Thread] Current Thread [Next in Thread]