Subject: bug#73404: 30.0.50; [forward/kill/etc]-sexp commands do not behave as expected in tree-sitter modes

From: Theodor Thornhill <[email-masked]>
Date: Sun, 05 Jan 2025 19:20:10 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Theodor Thornhill <[email-masked]>
>> Cc: [email-masked], [email-masked], [email-masked],
>>  [email-masked], [email-masked]
>> Date: Sun, 05 Jan 2025 13:30:31 +0100
>> 
>> > Is this goal achievable in practice, given the sometimes radical
>> > differences between languages?  Maybe we only can have examples and
>> > some dwim-ish behavior in most cases?
>> 
>> I'm not sure if it is achievable or not, but I think it'd be nice to
>> avoid any "hand-waviness" to confuse us while we talk about
>> sexps/lists/etc. I could try to document thoroughly how lisp-modes and
>> cc modes implement these and see if we have some glaring discrepancies
>> between just those two?
>
> They are not "discrepancies", and certainly not "glaring", but there
> are differences.  E.g., in c-ts-mode, we support "lists" enclosed in
> (..), {..}, and <..> (but not [..], for some reason).  You will not
> find anything like that in Lisp-like languages.
>

I didn't mean to sound harsh, my apoligies.

> So, if we want to have a broader picture, we will need to try more
> modes.  Can you or someone produce an exhaustive list of all TS modes
> we have that implement these movement commands?  Then we could try the
> commands in each one of those modes and see if there are common
> patterns that we can name and describe.
>

Sure!

> For now, my conclusion was that (almost) every parenthetical grouping
> supported by the language grammar can be moved across with these
> commands.  But I only tried Lisp and c-ts-mode.

Yeah, absolutely. I think it is moving in the right direction. What I'm
thinking of is more in the line of standarization as a conscious effort,
not by consequence of convention. The reason being to help aid us when
discussing these issues. I feel we often attribute bugs to our
subjective meaning, perhaps because we are missing some clearer
structure in the expected behavior. I'm absolutely open to being wrong
here, though.

Theo