(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.
This commit is contained in:
parent
06af71fbde
commit
2dea3a0d34
1 changed files with 7 additions and 4 deletions
|
@ -329,8 +329,8 @@ effect."
|
|||
|
||||
;;; Bindings
|
||||
|
||||
(defvar-keymap python-mode-map
|
||||
:doc "Keymap for `python-mode'."
|
||||
(defvar-keymap python-base-mode-map
|
||||
:doc "Keymap for `python-base-mode'."
|
||||
;; Movement
|
||||
"<remap> <backward-sentence>" #'python-nav-backward-block
|
||||
"<remap> <forward-sentence>" #'python-nav-forward-block
|
||||
|
@ -375,7 +375,7 @@ effect."
|
|||
|
||||
(defvar subword-mode nil)
|
||||
|
||||
(easy-menu-define python-menu python-mode-map
|
||||
(easy-menu-define python-menu python-base-mode-map
|
||||
"Menu used for ´python-mode'."
|
||||
'("Python"
|
||||
:help "Python-specific Features"
|
||||
|
@ -436,7 +436,10 @@ effect."
|
|||
:style toggle :selected subword-mode
|
||||
:help "Toggle subword movement and editing mode"])))
|
||||
|
||||
(defvar python-ts-mode-map (copy-keymap python-mode-map)
|
||||
(defvar python-mode-map (make-composed-keymap nil python-base-mode-map)
|
||||
"Keymap for `python-mode'.")
|
||||
|
||||
(defvar python-ts-mode-map (make-composed-keymap nil python-base-mode-map)
|
||||
"Keymap for `python-ts-mode'.")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue