GNU bug report logs - #64442
29.0.92; treesit-beginning-of-defun fails in DEFUN functions in C

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Mon, 3 Jul 2023 17:14:01 UTC

Severity: normal

Found in version 29.0.92

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 64442 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 64442 <at> debbugs.gnu.org
Subject: Re: bug#64442: 29.0.92; treesit-beginning-of-defun fails in DEFUN
 functions in C
Date: Sat, 12 Aug 2023 17:59:37 +0300
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Thu, 10 Aug 2023 14:33:09 -0700
> Cc: 64442 <at> debbugs.gnu.org
> 
> I still don’t have a good solution. But I just realized that we might be able to make a little compromise: what if Emacs recognizes DEFUN, but as two separate parts (the declaration and the body), rather than one? It’s hard to make it recognize DEFUN as a single defun, but making it recognize DEFUN as two parts is easy.
> 
> Try this patch and see if you like the behavior. Personally I find it quite alright.

I like this much better than what we have now, thanks.  But I have a
question: can we perhaps recognize the "function" of the body as such,
and then automatically move to the previous defun, which is the right
place?  The "defun" that is the body has no name, so maybe that could
be used as a sign?  That would allow "C-x 4 a" to work inside a DEFUN,
something that still works less reliably with this patch: you must be
in the "first defun" to get it to find the name of the function.

But if improving this is hard, I'll settle for what you have now,
thanks a lot.




This bug report was last modified 1 year and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.