diff options
| author | Yuan Fu | 2022-10-26 15:38:40 -0700 |
|---|---|---|
| committer | Yuan Fu | 2022-10-26 15:39:02 -0700 |
| commit | c352392420236d4fa7a8ac7f324f1a0358ad3584 (patch) | |
| tree | 58b47524ef61e4f1dd5f797e25445e504a592c64 /lisp/progmodes/python.el | |
| parent | 6fb6cb075f05629a562275064851bef6b72d5dd2 (diff) | |
| download | emacs-c352392420236d4fa7a8ac7f324f1a0358ad3584.tar.gz emacs-c352392420236d4fa7a8ac7f324f1a0358ad3584.zip | |
Add tree-sitter navigation support to python-mode
* lisp/progmodes/python.el (python-mode): Set
treesit-defun-type-regexp.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 4 |
1 files changed, 4 insertions, 0 deletions
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): " | |||
| 6473 | (setq-local treesit-font-lock-settings python--treesit-settings) | 6473 | (setq-local treesit-font-lock-settings python--treesit-settings) |
| 6474 | (setq-local imenu-create-index-function | 6474 | (setq-local imenu-create-index-function |
| 6475 | #'python-imenu-treesit-create-index) | 6475 | #'python-imenu-treesit-create-index) |
| 6476 | (setq-local treesit-defun-type-regexp (rx bol | ||
| 6477 | (or "function" "class") | ||
| 6478 | "_definition" | ||
| 6479 | eol)) | ||
| 6476 | (treesit-major-mode-setup)) | 6480 | (treesit-major-mode-setup)) |
| 6477 | ;; Elisp. | 6481 | ;; Elisp. |
| 6478 | (t | 6482 | (t |