Fix args in treesit-beginning-of-defun and treesit-end-of-defun

* lisp/treesit.el (treesit-beginning-of-defun): Set arg to 1 when nil.
(treesit-end-of-defun): Fix arg names in docstring.
This commit is contained in:
Juri Linkov 2025-01-29 19:58:10 +02:00
parent 25c254aa41
commit 6a92f674fe

View file

@ -2855,6 +2855,7 @@ not set, Emacs also looks for definition of defun in
(let ((orig-point (point))
(success nil)
(pred (or treesit-defun-type-regexp 'defun)))
(unless arg (setq arg 1))
(catch 'done
(dotimes (_ 2)
@ -2874,8 +2875,8 @@ not set, Emacs also looks for definition of defun in
(defun treesit-end-of-defun (&optional arg _)
"Move forward to next end of defun.
With argument ARG, do it that many times.
Negative argument -N means move back to Nth preceding end of defun.
With argument ARG, do it that many times. Negative ARG means
move back to the ARGth preceding end of defun.
This is a tree-sitter equivalent of `end-of-defun'. Behavior of
this function depends on `treesit-defun-type-regexp' and