[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp
From: |
Theodor Thornhill |
Subject: |
bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp |
Date: |
Wed, 18 Jan 2023 19:27:34 +0100 |
On 18 January 2023 18:09:29 CET, Juri Linkov <juri@linkov.net> wrote:
>> Consider HTML (or anything in SGML club of languages). I would expect
>> sexp movement to move over a matched pair of tags. It currently does
>> not; the reason why is understandable when you know how `syntax-ppss'
>> does (or does not, as it were) work. (You can equally make an argument
>> that it should simply go to the end of an opening/closing node and not
>> the pair, but that is personal preference.)
>>
>> `nxml-mode' handles it properly; Combobulate handles it properly, too.
>> But Combobulate also falls back to the classic sexp behaviour if it
>> cannot find a suitable node in the direction of travel.
>
>While ‘forward-sexp’ moves over the next tag, there is also ‘C-c C-f’
>(‘sgml-skip-tag-forward’) that moves over the whole element to the end tag.
>I'm not sure if sexp movement in nxml-mode is an improvement since
>there is no way to move over the tag only.
>
>To support both cases maybe ‘forward-sexp’ should move over the tag,
>and ‘forward-sentence’ over the whole element?
Yes! This is what I find intuitive, and have tried to explain in my docstrings
of the two.
But I'm new in town and want all to at least discuss:)
I can extract a forward-sexp-default-function to amend some of the damage?
Theo
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, (continued)
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Stefan Monnier, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Dmitry Gutov, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Stefan Monnier, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Dmitry Gutov, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Stefan Monnier, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Juri Linkov, 2023/01/18
- bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Theodor Thornhill, 2023/01/18
bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp, Mickey Petersen, 2023/01/18