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 15:31:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 17/01/2023 23:13, Mickey Petersen wrote:
3. What are the "rules"?

   In c-mode, elisp-mode without paredit forward-sexp won't jump out of
   the current scope, however with paredit enabled it will.


If we simply want some code similar to this to live and slowly evolve I
guess we can install something like this patch after some tweaks and
iterate when we have more experience.

The problem with that patch is -- and caveat, I do not use Java, so I
am not too versed in the details of the note types used -- but most of
the things I see are things that a normal sexp would work with anyway:

- true, false: they are just words, right?
- identifier: presumably a symbol or something that a decent syntax
   table would probably catch.
- parenthesized_expression: delimited by ( ), etc. ? Sexp handles that
- just fine.
- argument_list: presumably uses ( ) also

Yeah, it seems like in C-based languages (where any block of code is surrounded by curlier) the default forward-sexp should behave decently already.

Whether forward-sexp should jump over the whole if () { ... } expression, for example, is a matter of taste. Not so with e.g. Python, where an 'if' statement can have zero parens and no visible terminator.






reply via email to

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