From: Yuan Fu Date: Wed, 26 Oct 2022 22:38:40 +0000 (-0700) Subject: Add tree-sitter navigation support to python-mode X-Git-Tag: emacs-29.0.90~1781 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c352392420236d4fa7a8ac7f324f1a0358ad3584;p=emacs.git Add tree-sitter navigation support to python-mode * lisp/progmodes/python.el (python-mode): Set treesit-defun-type-regexp. --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 2c0c35174c2..97839366350 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6473,6 +6473,10 @@ Add import for undefined name `%s' (empty to skip): " (setq-local treesit-font-lock-settings python--treesit-settings) (setq-local imenu-create-index-function #'python-imenu-treesit-create-index) + (setq-local treesit-defun-type-regexp (rx bol + (or "function" "class") + "_definition" + eol)) (treesit-major-mode-setup)) ;; Elisp. (t