]> git.eshelyaron.com Git - emacs.git/commit
Generalize treesit-defun functions to "things"
authorYuan Fu <casouri@gmail.com>
Sun, 25 Dec 2022 04:17:08 +0000 (20:17 -0800)
committerYuan Fu <casouri@gmail.com>
Sun, 25 Dec 2022 09:11:47 +0000 (01:11 -0800)
commita819ca5a93c56f7647940f6e8ef05503eecf4e9e
tree5e42727245e5b9167c9a47e7fd44e0543e3c550f
parente8b34109eeb136bdab5b970600214cf1fc92ca0c
Generalize treesit-defun functions to "things"

Change the "defun" in some functions (e.g. treesit--defuns-around) to
"thing".  Add a function treesit-thing-at-point.

* lisp/treesit.el (treesit--thing-unpack-pattern): New subroutine.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Use new function treesit--navigate-thing.
(treesit--defuns-around): Generalize into treesit--thing-around.
(treesit--top-level-defun): Generalize into treesit--top-level-thing.
(treesit--navigate-defun): Generalize into treesit--navigate-thing.
(treesit-thing-at-point): Generalized from treesit-defun-at-point.
(treesit-defun-at-point): Use treesit-thing-at-point to do tht work.
lisp/treesit.el