From 35e2786c930d5c2125f2af8d1c224a480181dce9 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Thu, 19 May 2022 09:35:13 -0700 Subject: [PATCH] Fix typo and argument in treesit-beginning-of-defun, etc * lisp/treesit.el (treesit-beginning-of-defun, treesit-end-of-defun): Fix typo, add shield for argument. --- lisp/treesit.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 3313168d667..761c7147a0e 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -927,20 +927,20 @@ functions like `treesit-beginning-of-defun'.") With ARG, do it that many times. Negative ARG means move forward to the ARGth following beginning of defun. Defun is defined -according to `treesit-defun-pattern'." +according to `treesit-defun-query'." (unless treesit-defun-query (error "Variable `treesit-defun-query' is unset")) - (treesit-search-beginning treesit-defun-query (- arg))) + (treesit-search-beginning treesit-defun-query (- (or arg 1)))) (defun treesit-end-of-defun (&optional arg) "Move forward to the end of a defun. With ARG, do it that many times. Negative ARG means move back to ARGth preceding end of defun. Defun is defined according to -`treesit-defun-pattern'." +`treesit-defun-query'." (unless treesit-defun-query (error "Variable `treesit-defun-query' is unset")) - (treesit-search-end treesit-defun-query arg)) + (treesit-search-end treesit-defun-query (or arg 1))) ;;; Debugging -- 2.39.5