]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the call to treesit-thing-defined-p
authorYuan Fu <casouri@gmail.com>
Tue, 29 Oct 2024 02:30:52 +0000 (19:30 -0700)
committerEshel Yaron <me@eshelyaron.com>
Tue, 29 Oct 2024 10:00:03 +0000 (11:00 +0100)
* lisp/treesit.el (treesit-defun-at-point): Add the necessary
2nd argument.

(cherry picked from commit 1551c306f30cc139b321056c03206df4b71eae5c)

lisp/treesit.el

index 91efdb30f31571896f1dc096fed8c3bddc3d17d6..55b6349139d07ccfaf9b6625d4d05f80c59fd283 100644 (file)
@@ -2826,7 +2826,9 @@ is `nested'.
 
 Return nil if `treesit-defun-type-regexp' isn't set and `defun'
 isn't defined in `treesit-thing-settings'."
-  (when (or treesit-defun-type-regexp (treesit-thing-defined-p 'defun))
+  (when (or treesit-defun-type-regexp
+            (treesit-thing-defined-p
+             'defun (treesit-language-at (point))))
     (treesit-thing-at-point
      (or treesit-defun-type-regexp 'defun) treesit-defun-tactic)))