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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Jan 2025 18:59:54 +0200

> 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.

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.

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.