Daniel Martín writes: > Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife > of text editors" 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". They aren't really proper propsals. Mostly some example values to show that the code works. The problem with just stating "statements" is that the names are different across parsers. So in java one would call ``` void foo() { var foo = 5; // <-- This thing } ``` A "local_variable_declaration" or something like that. But it would make sense for M-e to move across that whole line. So this is language dependent, I believe. > > As a suggestion, treesit-forward-sentence could navigate by textual > sentences when point is inside comments or strings. > Yeah, this is a good idea - added in following patch. >> +** 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 > Thanks - fixed. > Also, this feature probably needs an update to the Info documentation to > mention that Tree-sitter can specialize sentence commands in programming > modes. Yes, likely. I will add this a bit later, when we agree on its behavior fully :) @Eli, what doc changes do you see as needed here? @Juri: I added a change with how I understood what you meant. Is that in your line of reasoning? Theo