projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fb6cb0
)
Add tree-sitter navigation support to python-mode
author
Yuan Fu
<casouri@gmail.com>
Wed, 26 Oct 2022 22:38:40 +0000
(15:38 -0700)
committer
Yuan Fu
<casouri@gmail.com>
Wed, 26 Oct 2022 22:39:02 +0000
(15:39 -0700)
* lisp/progmodes/python.el (python-mode): Set
treesit-defun-type-regexp.
lisp/progmodes/python.el
patch
|
blob
|
history
diff --git
a/lisp/progmodes/python.el
b/lisp/progmodes/python.el
index 2c0c35174c2621c58d2acdeef319368b00140c47..9783936635010e7de67069304a875eee57aebaab 100644
(file)
--- 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