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

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

bug#60623: 30.0.50; Add forward-sentence with tree sitter support


From: Daniel Martín
Subject: bug#60623: 30.0.50; Add forward-sentence with tree sitter support
Date: Sat, 07 Jan 2023 16:41:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)

Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife
of text editors" <bug-gnu-emacs@gnu.org> writes:

> Hi all!
>
> This patch tweaks the forward-sentence function to be usable with
> tree-sitter.
>
> It follows the same style as the recent change in transpose-sexps, so I
> hope it isn't too controversial.

Thanks.

>
> What exact node types do you consider useful for sentence movement?
>

I haven't thought much about your proposed nodes, I initially thought
that sentences in a programming language are just "statements".

As a suggestion, treesit-forward-sentence could navigate by textual
sentences when point is inside comments or strings.

> +** New defvar-local forward-sentence-function.
> +The previous implementation of 'forward-sentence' is moved into this
> +variable, which can be set to customize the sentece movement behavior.
                                               ^^^^^^^
                                               sentence

Also, this feature probably needs an update to the Info documentation to
mention that Tree-sitter can specialize sentence commands in programming
modes.




reply via email to

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