aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorStefan Monnier2025-03-06 23:23:08 -0500
committerStefan Monnier2025-03-06 23:23:08 -0500
commit2dea3a0d34859852d3577f6054acb49f6e515eb2 (patch)
treed02ffc6d8a25b6a0e80841207cc7b1dfe88c48c4 /lisp/progmodes/python.el
parent06af71fbde9378384672a99048bb56ed4ac9a834 (diff)
downloademacs-2dea3a0d34859852d3577f6054acb49f6e515eb2.tar.gz
emacs-2dea3a0d34859852d3577f6054acb49f6e515eb2.zip
(python-base-mode-map): Use it!
Rather than use `copy-keymap` between `python-mode-map` and `python-ts-mode-map`, move the shared bindings to `python-base-mode-map`. * lisp/progmodes/python.el (python-base-mode-map): Define it explicitly. Move all the bindings of `python-mode-map` to it. (python-mode-map, python-ts-mode-map): Inherit from it.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 2a95a45f6f2..d55ce1f7fb1 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -329,8 +329,8 @@ effect."
329 329
330;;; Bindings 330;;; Bindings
331 331
332(defvar-keymap python-mode-map 332(defvar-keymap python-base-mode-map
333 :doc "Keymap for `python-mode'." 333 :doc "Keymap for `python-base-mode'."
334 ;; Movement 334 ;; Movement
335 "<remap> <backward-sentence>" #'python-nav-backward-block 335 "<remap> <backward-sentence>" #'python-nav-backward-block
336 "<remap> <forward-sentence>" #'python-nav-forward-block 336 "<remap> <forward-sentence>" #'python-nav-forward-block
@@ -375,7 +375,7 @@ effect."
375 375
376(defvar subword-mode nil) 376(defvar subword-mode nil)
377 377
378(easy-menu-define python-menu python-mode-map 378(easy-menu-define python-menu python-base-mode-map
379 "Menu used for ´python-mode'." 379 "Menu used for ´python-mode'."
380 '("Python" 380 '("Python"
381 :help "Python-specific Features" 381 :help "Python-specific Features"
@@ -436,7 +436,10 @@ effect."
436 :style toggle :selected subword-mode 436 :style toggle :selected subword-mode
437 :help "Toggle subword movement and editing mode"]))) 437 :help "Toggle subword movement and editing mode"])))
438 438
439(defvar python-ts-mode-map (copy-keymap python-mode-map) 439(defvar python-mode-map (make-composed-keymap nil python-base-mode-map)
440 "Keymap for `python-mode'.")
441
442(defvar python-ts-mode-map (make-composed-keymap nil python-base-mode-map)
440 "Keymap for `python-ts-mode'.") 443 "Keymap for `python-ts-mode'.")
441 444
442 445