GNU bug report logs - #59628
29.0.50; treesit-beginning/end-of-defun problems in C/C++

Previous Next

Package: emacs;

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

Date: Sun, 27 Nov 2022 10:13:01 UTC

Severity: normal

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 59628-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 59628-done <at> debbugs.gnu.org, mardani29 <at> yahoo.es
Subject: Re: bug#59628: 29.0.50; treesit-beginning/end-of-defun problems in 
 C/C++
Date: Thu, 01 Dec 2022 10:08:43 +0200
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Wed, 30 Nov 2022 15:07:45 -0800
> Cc: eliz <at> gnu.org,
>  59628 <at> debbugs.gnu.org
> 
> 
> Daniel Martín <mardani29 <at> yahoo.es> writes:
> 
> > Yuan Fu <casouri <at> gmail.com> writes:
> >
> >>
> >> Different languages have different grammars that give different names to
> >> function definitions and class definitions. So it is necessary to have a
> >> regexp variable. Finding such a regexp isn’t too hard, so I don’t think
> >> we need a default value. If we do have a default, it would be often wrong,
> >> given differences between language grammars.
> >
> > I see that each major mode sets the value of that buffer-local variable.
> > c-ts-mode sets it to "\\(?:definition\\|specifier\\)" but, is that
> > correct?  In C code, treesit-explore-mode shows function definition
> > nodes as "function_definition", so I think the regexp is matching more
> > nodes than expected, causing C-M-a C-M-e to move to weird places in the
> > buffer.
> 
> Right, I’ve fixed the value in 599369bf3a3.

Thanks, this seems to work now as expected.  So I'm closing the bug.




This bug report was last modified 2 years and 231 days ago.

Previous Next


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