]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix usage of 'treesit-defun-type-regexp' in treesit-tests.
authorJuri Linkov <juri@linkov.net>
Wed, 25 Jun 2025 16:45:54 +0000 (19:45 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 19:18:47 +0000 (21:18 +0200)
* test/src/treesit-tests.el (treesit--ert-test-defun-navigation):
Replace 'treesit-defun-type-regexp' with
'(or treesit-defun-type-regexp 'defun)' that fixes the tests
for ts-modes that set up the 'defun' thing instead of
'treesit-defun-type-regexp'.

(cherry picked from commit 789a6b969345d6f9e0c8604bff8618d20a6cf536)

test/src/treesit-tests.el

index c151a86c5e53a2b3186a67efafb73750d26435d2..b5ea63a53f364526db6bd42f48c6beea5b3ee7bd 100644 (file)
@@ -1138,10 +1138,11 @@ and \"]\"."
            ;; Four functions: next-end, prev-beg, next-beg, prev-end.
            (mapcar (lambda (conf)
                      (lambda ()
-                       (if-let ((pos (funcall
-                                      #'treesit-navigate-thing
-                                      (point) (car conf) (cdr conf)
-                                      treesit-defun-type-regexp tactic)))
+                       (if-let* ((pos (funcall
+                                       #'treesit-navigate-thing
+                                       (point) (car conf) (cdr conf)
+                                       (or treesit-defun-type-regexp 'defun)
+                                       tactic)))
                            (save-excursion
                              (goto-char pos)
                              (funcall treesit-defun-skipper)