all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Theodor Thornhill <theo@thornhill.no>, 60894@debbugs.gnu.org
Cc: Mickey Petersen <mickey@masteringemacs.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Juri Linkov <juri@linkov.net>
Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp
Date: Wed, 18 Jan 2023 03:50:41 +0200	[thread overview]
Message-ID: <847c7696-1884-d801-150e-4589a6c4b0e7@yandex.ru> (raw)
In-Reply-To: <87358827ku.fsf@thornhill.no>

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	other threads:[~2023-01-18  1:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 20:44 bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-17 20:53 ` Dmitry Gutov
2023-01-17 21:07   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18  1:50     ` Dmitry Gutov [this message]
2023-01-18  5:35       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 12:21         ` Eli Zaretskii
2023-01-18 13:39         ` Dmitry Gutov
2023-01-18 18:28           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 19:01           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 21:59             ` Dmitry Gutov
2023-01-19  2:43               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-19  3:30                 ` Dmitry Gutov
2023-01-19  3:58                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-19 18:44                     ` Dmitry Gutov
2023-01-19 19:03                       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 17:16         ` Juri Linkov
2023-01-18 18:27           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-17 21:13 ` Mickey Petersen
2023-01-18 13:31   ` Dmitry Gutov
2023-01-18 17:09   ` Juri Linkov
2023-01-18 18:27     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 18:55       ` Juri Linkov
2023-01-18 22:06       ` Dmitry Gutov
2023-01-19  6:24         ` Eli Zaretskii
2023-01-19  7:58         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=847c7696-1884-d801-150e-4589a6c4b0e7@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=60894@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=mickey@masteringemacs.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.