bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64442: 29.0.92; treesit-beginning-of-defun fails in DEFUN functions


From: Yuan Fu
Subject: bug#64442: 29.0.92; treesit-beginning-of-defun fails in DEFUN functions in C
Date: Tue, 11 Jul 2023 19:10:01 -0700


> On Jul 6, 2023, at 11:40 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Thu, 6 Jul 2023 23:15:00 -0700
>> Cc: 64442@debbugs.gnu.org
>> 
>>> On Jul 4, 2023, at 4:39 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> 
>>> Why cannot we look for a top-level expression_statement node which is
>>> a call_expression whose function identifier is "DEFUN" and whose
>>> position is between the place where C-M-a was invoked and the place
>>> where it does find a defun?
>> 
>> It’s gonna be ugly, but I can take a jab at it this weekend. I’m thinking of 
>> a wrapper function that tries to detect DEFUN before falling back to the 
>> ordinary tree-sitter defun movement function.
> 
> Thanks.  let's see how ugly it is before deciding whether it's worth it.
> 
>>> DEFUN's cannot be nested, so we don't need to consider that.
>> 
>> Yeah, in general C sources don’t have nested defuns, only C++ ones do.
> 
> No, I meant the use of DEFUN macros in Emacs cannot be nested.

Just an update. I didn’t forget about this, but it’s more harder than I thought 
and I’m still working on it :-(

Yuan




reply via email to

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