]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix args in treesit-beginning-of-defun and treesit-end-of-defun
authorJuri Linkov <juri@linkov.net>
Wed, 29 Jan 2025 17:58:10 +0000 (19:58 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:13:26 +0000 (19:13 +0100)
* lisp/treesit.el (treesit-beginning-of-defun): Set arg to 1 when nil.
(treesit-end-of-defun): Fix arg names in docstring.

(cherry picked from commit 6a92f674fe5123742b2c1bc890bab7b3743582c8)

lisp/treesit.el

index e05c74f414363ff4de8383df083f49eede21c569..4cca074c304caf1597b1c35effec84bc8598cdac 100644 (file)
@@ -2847,6 +2847,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)
 
@@ -2866,8 +2867,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