[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plug treesit.el into other emacs constructs
From: |
Yuan Fu |
Subject: |
Re: Plug treesit.el into other emacs constructs |
Date: |
Tue, 13 Dec 2022 11:53:18 -0800 |
>
>> I mean, what construct is each one expected to jump over?
>
> In my book "sexp" movement should jump over subtrees of the AST.
It’s pretty hard to judge which subtree to move over at a given point in an
AST. For example, when point is at | in the following text:
(|X.y(z), alpha)
Should point move over X, or X.y, or X.y(z)? All three subtrees has their
beg=(point). A human can tell (and might disagree on) which unit to move
across, but a program couldn’t tell. Without language specific knowledge, it
can’t really decide.
Just a thought, but maybe we can let major modes define what’s an “abstract
list”, and sexp-forward would move across the immediate children of abstract
lists. Eg, abstract lists in C would contain block, argument list, statement,
etc. And in the example above forward-sexp would move across X.y(z) because
it’s an immediate children of the enclosing abstract list, the argument list.
Yuan
- Plug treesit.el into other emacs constructs, Theodor Thornhill, 2022/12/12
- Re: Plug treesit.el into other emacs constructs, Eli Zaretskii, 2022/12/12
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/12
- Re: Plug treesit.el into other emacs constructs, Theodor Thornhill, 2022/12/13
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/13
- Re: Plug treesit.el into other emacs constructs,
Yuan Fu <=
- Re: Plug treesit.el into other emacs constructs, Perry Smith, 2022/12/13
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/13
- Re: Plug treesit.el into other emacs constructs, Yuan Fu, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Theodor Thornhill, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Theodor Thornhill, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Theodor Thornhill, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/14
- Re: Plug treesit.el into other emacs constructs, Stefan Monnier, 2022/12/14