aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-05-12 10:11:18 +0100
committerSean Whitton2025-05-12 10:11:18 +0100
commit4ddafede8d7bebdaa795279cc4c527e5fe425add (patch)
tree4c23c8b3de7ade9732e240d8ea6980b640bda865
parent882c849034a909a62179c38ee01cc08572fa1a68 (diff)
downloademacs-4ddafede8d7bebdaa795279cc4c527e5fe425add.tar.gz
emacs-4ddafede8d7bebdaa795279cc4c527e5fe425add.zip
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): <diff-mode-read-only>: Ensure that the minor mode keymap continues to inherit from special-mode-map by calling make-composed-keymap here. Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
-rw-r--r--lisp/vc/diff-mode.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 18f467eee74..c76c916ec70 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,
180;;;; 180;;;;
181 181
182(defvar-keymap diff-mode-shared-map 182(defvar-keymap diff-mode-shared-map
183 :parent special-mode-map
184 "n" #'diff-hunk-next 183 "n" #'diff-hunk-next
185 "N" #'diff-file-next 184 "N" #'diff-file-next
186 "p" #'diff-hunk-prev 185 "p" #'diff-hunk-prev
@@ -207,8 +206,7 @@ The default \"-b\" means to ignore whitespace-only changes,
207 ;; We want to inherit most bindings from 206 ;; We want to inherit most bindings from
208 ;; `diff-mode-shared-map', but not all since they may hide 207 ;; `diff-mode-shared-map', but not all since they may hide
209 ;; useful `M-<foo>' global bindings when editing. 208 ;; useful `M-<foo>' global bindings when editing.
210 (dolist (key '("A" "r" "R" "g" "q" "W" "w" "z" "?" 209 (dolist (key '("A" "r" "R" "W" "w"))
211 "SPC" "S-SPC" "DEL"))
212 (keymap-set map key nil)) 210 (keymap-set map key nil))
213 map) 211 map)
214 ;; From compilation-minor-mode. 212 ;; From compilation-minor-mode.
@@ -1599,7 +1597,9 @@ else cover the whole buffer."
1599;; It should be lower than `outline-minor-mode' and `view-mode'. 1597;; It should be lower than `outline-minor-mode' and `view-mode'.
1600(or (assq 'diff-mode-read-only minor-mode-map-alist) 1598(or (assq 'diff-mode-read-only minor-mode-map-alist)
1601 (nconc minor-mode-map-alist 1599 (nconc minor-mode-map-alist
1602 (list (cons 'diff-mode-read-only diff-mode-shared-map)))) 1600 (list (cons 'diff-mode-read-only
1601 (make-composed-keymap diff-mode-shared-map
1602 special-mode-map)))))
1603 1603
1604(defvar whitespace-style) 1604(defvar whitespace-style)
1605(defvar whitespace-trailing-regexp) 1605(defvar whitespace-trailing-regexp)