]> git.eshelyaron.com Git - emacs.git/commit
Partial support for DEFUN in c-ts-mode (bug#62825)
authorYuan Fu <casouri@gmail.com>
Fri, 14 Apr 2023 19:52:46 +0000 (12:52 -0700)
committerYuan Fu <casouri@gmail.com>
Fri, 14 Apr 2023 20:09:05 +0000 (13:09 -0700)
commitb3603b84bd9c0e2f0fbd6cc49d4d086e7b08735a
tree3a4856661647c8f9ab41cd0b0ad1ad09075b1692
parent14e809ddff1e60fb53d8570d9b5cfa3cb134858f
Partial support for DEFUN in c-ts-mode (bug#62825)

The DEFUN is hard to incorporate because it's made of two nodes rather
than one, and most tree-sitter functionalities assume a defun is one
node.  I fixed the indent-defun and add-log functionality, but
beginning/end-of-defun and imenu still don't recognize DEFUN.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-emacs-devel): New variable.
(c-ts-mode--defun-name): Support DEFUN.
(c-ts-mode--defun-valid-p): Support DEFUN.
(c-ts-mode--emacs-defun-p)
(c-ts-mode--emacs-defun-at-point): New functions.
(c-ts-mode-indent-defun): Use c-ts-mode--emacs-defun-at-point.
(c-ts-mode--emacs-current-defun-name): New function.
(c-ts-mode, c++-ts-mode): Optionally setup custom defun-name function.
lisp/progmodes/c-ts-mode.el