emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/tree-sitter 35e2786c93 01/26: Fix typo and argument in treesit-b


From: Yuan Fu
Subject: feature/tree-sitter 35e2786c93 01/26: Fix typo and argument in treesit-beginning-of-defun, etc
Date: Thu, 16 Jun 2022 14:53:45 -0400 (EDT)

branch: feature/tree-sitter
commit 35e2786c930d5c2125f2af8d1c224a480181dce9
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Yuan Fu <casouri@gmail.com>

    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 3313168d66..761c7147a0 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]