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: Dmitry Gutov
Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp
Date: Wed, 18 Jan 2023 03:50:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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.





reply via email to

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