From c8469f5c722b56bfaf29595476da8cc086036358 Mon Sep 17 00:00:00 2001 From: Michael Eliachevitch Date: Fri, 16 Dec 2022 15:00:16 +0100 Subject: [PATCH] Support emacs29 python-ts-mode --- modes/python/evil-collection-python.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modes/python/evil-collection-python.el b/modes/python/evil-collection-python.el index 7813118..96e2956 100644 --- a/modes/python/evil-collection-python.el +++ b/modes/python/evil-collection-python.el @@ -30,7 +30,9 @@ (require 'evil-collection) (require 'python) -(defconst evil-collection-python-maps '(python-mode-map)) +(defconst evil-collection-python-maps '(python-mode-map + python-ts-mode-map + python-base-mode-map)) (defun evil-collection-python-set-evil-shift-width () "Set `evil-shift-width' according to `python-indent-offset'." @@ -39,10 +41,12 @@ ;;;###autoload (defun evil-collection-python-setup () "Set up `evil' bindings for `python'." - (add-hook 'python-mode-hook #'evil-collection-python-set-evil-shift-width) + (dolist (hook '(python-mode-hook python-ts-mode-hook)) + (add-hook hook #'evil-collection-python-set-evil-shift-width)) - (evil-collection-define-key 'normal 'python-mode-map - "gz" 'python-shell-switch-to-shell)) + (dolist (kmap evil-collection-python-maps) + (evil-collection-define-key 'normal kmap + "gz" 'python-shell-switch-to-shell))) (provide 'evil-collection-python) ;;; evil-collection-python.el ends here