[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl
From: |
Theodor Thornhill |
Subject: |
bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl |
Date: |
Wed, 21 Dec 2022 08:42:38 +0100 |
On 21 December 2022 07:50:04 CET, Yuan Fu <casouri@gmail.com> wrote:
>
>Yuan Fu <casouri@gmail.com> writes:
>
>> Theodor Thornhill <theo@thornhill.no> writes:
>>
>>> Hi, Yuan!
>>>
>>> It seems 'prog-fill-reindent-defun' is broken after the latest changes
>>> to treesit-beginning-of-defun. The culprit is that we now use remap
>>> instead of setting the beginning-of-defun-function. What is the
>>> reasoning behind that change? Can't we just rely on the variable
>>> beginning-of-defun-function?
>>
>> Not really, end-of-defun uses beginning/end-of-defun-function in a way
>> that’s incompatible with nested defuns[1]. So if we want to support
>> navigation nested defuns reliably we need to remap the commands instead.
>> In the future (ie emacs 30), we can extend the current
>> beginning/end-of-defun to support nested defuns, then we don’t need to
>> remap the commands anymore.
>
>I see the problem now... Many other functions uses
>beginning/end-of-defun. I didn’t thought about that initially :-(
>
>But I don’t want to make big changes to beg/end-of-deun, hmmm.
>
>Yuan
I think you can set the functions and remap, right? Maybe you can force the
beginning-of-defun-function variant to choose the smallest scope as a default?
Or just follow the same tactic the user set?
Theo
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Theodor Thornhill, 2022/12/19
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Theodor Thornhill, 2022/12/20
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Yuan Fu, 2022/12/20
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Yuan Fu, 2022/12/21
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl,
Theodor Thornhill <=
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Yuan Fu, 2022/12/22
- bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl, Yuan Fu, 2022/12/22