From: Juri Linkov <juri@linkov.net>
To: Yuan Fu <casouri@gmail.com>
Cc: 68993@debbugs.gnu.org
Subject: bug#68993: treesitter support for forward-sexp-default-function
Date: Sat, 10 Feb 2024 19:46:46 +0200 [thread overview]
Message-ID: <86a5o86wl5.fsf@mail.linkov.net> (raw)
In-Reply-To: <86y1bv6jsm.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 08 Feb 2024 19:38:17 +0200")
Hi Yuan,
Do you think 'comment' is a suitable name for 'treesit-forward-sexp'?
I'm unsure even if 'text' is a good name for 'treesit-forward-sentence'.
But at least these two should be consistent with each another.
Maybe better to add the prefix 'default-' to both?
This will hint that the default function is used.
Then 'treesit-forward-sentence' will support types
'sentence' and 'default-sentence'.
And 'treesit-forward-sexp' will support types
'sexp' and 'default-sexp'.
> @@ -2137,7 +2137,10 @@ treesit-forward-sexp
> (interactive "^p")
> (let ((arg (or arg 1))
> (pred (or treesit-sexp-type-regexp 'sexp)))
> - (or (if (> arg 0)
> + (or (when (treesit-node-match-p (treesit-node-at (point)) 'comment t)
> + (funcall #'forward-sexp-default-function arg)
> + t)
> + (if (> arg 0)
> (treesit-end-of-thing pred (abs arg) 'restricted)
> (treesit-beginning-of-thing pred (abs arg) 'restricted))
> ;; If we couldn't move, we should signal an error and report
next prev parent reply other threads:[~2024-02-10 17:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 17:38 bug#68993: treesitter support for forward-sexp-default-function Juri Linkov
2024-02-10 17:46 ` Juri Linkov [this message]
2024-02-12 1:28 ` Yuan Fu
2024-04-10 18:03 ` Juri Linkov
2024-02-12 1:42 ` Yuan Fu
2024-02-12 18:41 ` Juri Linkov
2024-04-16 10:15 ` Mattias Engdegård
2024-04-17 6:54 ` Juri Linkov
[not found] <5BB812B1-6A9F-4F9D-89C5-A4A1A191409C@gmail.com>
2024-04-14 16:23 ` 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=86a5o86wl5.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=68993@debbugs.gnu.org \
--cc=casouri@gmail.com \
/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.