bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp


From: Theodor Thornhill
Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp
Date: Wed, 18 Jan 2023 06:35:36 +0100

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 17/01/2023 23:07, Theodor Thornhill via Bug reports for GNU Emacs, 
> the Swiss army knife of text editors wrote:
>> Test this very untested addition to the patch (I know no ruby).  It
>> seems to do what you want.  I'd consider this sentence movement, though.
>> For M-e
>
> That seems to be working rather well, thanks. I just needed to extend 
> the list of nodes:
>
>    (setq-local treesit-sexp-type-regexp
>                (regexp-opt '("class"
>                              "module"
>                              "method"
>                              "argument_list"
>                              "array"
>                              "hash"
>                              "parenthesized_statements"
>                              "if"
>                              "case"
>                              "block"
>                              "do_block"
>                              "begin")))
>
> With array, hash, etc, you see it's not exactly like a sentence.
>
> Regarding your previous question -- whether forward-sexp should jump 
> over the arglist together with the called method name -- ruby-mode's 
> answer to that is:
>
> - If point is before ".", jump over ".bar(...)".
> - If point is after ".", jump over "bar" only.
>
> But the difference is more subtle here, and different people might have 
> different preferences. This also seems more difficult to express via 
> node types since "." is in the middle of the (call) node.

Yeah, it's not the easiest problem, but we can wait until we get more
experience in other modes too to solidify this design.  It is not for
pemacs-29 anyway, so we have time.

Added some words to the manual and your node types to ruby-ts-mode

Theo

Attachment: 0001-Add-treesit-forward-sexp.patch
Description: Text Data


reply via email to

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