]> git.eshelyaron.com Git - emacs.git/commit
Change function signiture of treesit search functions
authorYuan Fu <casouri@gmail.com>
Sun, 23 Oct 2022 21:56:17 +0000 (14:56 -0700)
committerYuan Fu <casouri@gmail.com>
Sun, 23 Oct 2022 22:19:00 +0000 (15:19 -0700)
commitfa9bede36c18d063f6f599e102cd42f9d0afc071
tree84e6aa43f6980f03b6ff321ae5c72f894ab56363
parent6a2399c55e9505be06cb98ffbe1a3878f9e96fb2
Change function signiture of treesit search functions

Justification: We want to make the SIDE argument in
treesit-search-forward-goto optional, so I changed it to START.
It makes more sense for BACKWARD to follow START so two common
case, search for end forward and beginning backwards are

(treesit-search-forward-goto node pred)
(treesit-search-forward-goto node pred t t)

Then since we swapped BACKWARD and ALL for
treesit-search-forward-goto, it's best to swap them for
treesit-search-forward and treesit-search-subtree, too.  And BACKWARD
will probably be used more frequently than ALL anyway.

* doc/lispref/parsing.texi (Retrieving Node): Resolve FIXME and update
function signitures.
* lisp/treesit.el (treesit-search-forward-goto): Change SIDE to
START, swap BACKWARD and ALL.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Update use of treesit-search-forward-goto
* src/treesit.c (Ftreesit_search_subtree)
(Ftreesit_search_forward): Swap BACKWARD and ALL.
doc/lispref/parsing.texi
lisp/treesit.el
src/treesit.c