]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix typo and argument in treesit-beginning-of-defun, etc
authorTheodor Thornhill <theo@thornhill.no>
Thu, 19 May 2022 16:35:13 +0000 (09:35 -0700)
committerYuan Fu <casouri@gmail.com>
Fri, 20 May 2022 02:06:12 +0000 (19:06 -0700)
* lisp/treesit.el (treesit-beginning-of-defun, treesit-end-of-defun):
Fix typo, add shield for argument.

lisp/treesit.el

index 3313168d667e53bdf007518594f8fb92b4cefe14..761c7147a0e94bc7652cde8f804558d6d1280ec5 100644 (file)
@@ -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