From: Sean Whitton Date: Mon, 12 May 2025 09:11:18 +0000 (+0100) Subject: diff-mode-shared-map: Don't inherit from special-mode-map X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=78b75f45d02867f0849885b1f4aecc5eecf58392;p=emacs.git diff-mode-shared-map: Don't inherit from special-mode-map * lisp/vc/diff-mode.el (diff-mode-shared-map): No longer inherit from special-mode-map. (diff-mode-map): Tidy up list of unbindings now that we no longer need to override any bindings from special-mode-map. (minor-mode-map-alist): : Ensure that the minor mode keymap continues to inherit from special-mode-map by calling make-composed-keymap here. Co-authored-by: Stefan Monnier (cherry picked from commit 4ddafede8d7bebdaa795279cc4c527e5fe425add) --- diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index e0579331fa0..08ca9f26d1e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -180,7 +180,6 @@ The default \"-b\" means to ignore whitespace-only changes, ;;;; (defvar-keymap diff-mode-shared-map - :parent special-mode-map "n" #'diff-hunk-next "N" #'diff-file-next "p" #'diff-hunk-prev @@ -206,8 +205,7 @@ The default \"-b\" means to ignore whitespace-only changes, ;; We want to inherit most bindings from ;; `diff-mode-shared-map', but not all since they may hide ;; useful `M-' global bindings when editing. - (dolist (key '("A" "r" "R" "g" "q" "W" "w" "z" "?" - "SPC" "S-SPC" "DEL")) + (dolist (key '("A" "r" "R" "W" "w")) (keymap-set map key nil)) map) ;; From compilation-minor-mode. @@ -1598,7 +1596,9 @@ else cover the whole buffer." ;; It should be lower than `outline-minor-mode' and `view-mode'. (or (assq 'diff-mode-read-only minor-mode-map-alist) (nconc minor-mode-map-alist - (list (cons 'diff-mode-read-only diff-mode-shared-map)))) + (list (cons 'diff-mode-read-only + (make-composed-keymap diff-mode-shared-map + special-mode-map))))) (defvar whitespace-style) (defvar whitespace-trailing-regexp)