Subject: Re: bug#78703: beginning-of-defun and friends still wrong in typescript-ts-mode

From: Daniel Colascione <[email-masked]>
Date: Wed, 11 Jun 2025 07:23:24 -0700

Daniel Colascione <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>>> 
>>> Users really prefer go-to-sibling behavior for beginning-of-defun?
>>
>> Turns out that way.
>>
>>> Says who?
>>
>> Users.
>
> Do they?  Which ones?  What every user I've seen dislike more than any
> default is inconsistency, especially gratuitous inconsistencies between
> things that are logically the same and happen to have divergent
> implementation details.  I find it impossible to believe that real
> users, in code like this:
>
> function foo() {
>   blah;
>   function bar() {
>     ...
>   }
>   // [Snip four pages]
>   for (let x of y) {
>     [point]
>   } 
> }
>
> When pressing C-M-a, want to go to the definition of bar, not the
> definition foo.  It doesn't make any sense to me that anyone would want
> to perform that operation.  If you're going to insist on bad defaults,
> you're just going to drive more people to Doom and such.

To clarify, the behavior above is useless because it's impossible to
predict.  With standard behavior, I can see, in the modeline, that I'm
in a defun called "foo".  I can reason, therefore, that if I type C-M-a,
I will go to the start of foo.  I can predict the effect of my actions.
I can't predict the behavior of C-M-a with the current TS default.
Maybe it'll go to bar.  Maybe someone deleted bar in a merge and it'll
go to foo.  Maybe someone added a guy after bar and C-M-a will go there
instead.  I can't know in advance.  This lack of predictability makes
C-M-a as a whole less useful.