[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59628: 29.0.50; treesit-beginning/end-of-defun problems in C/C++
From: |
Daniel Martín |
Subject: |
bug#59628: 29.0.50; treesit-beginning/end-of-defun problems in C/C++ |
Date: |
Tue, 29 Nov 2022 01:12:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) |
Yuan Fu <casouri@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.