From 10aa35bab7d624fed2b267fc48ebb05e839da57c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 5 Feb 2026 11:49:28 +0000 Subject: [PATCH] Bind "u", "@" in diff-mode-read-only-map, not diff-mode-shared-map * lisp/vc/diff-mode.el (diff-mode-shared-map): Move bindings for "u" and "@" from here ... (diff-mode-read-only-map): ... to here. --- lisp/vc/diff-mode.el | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index b4389de8a7b..0b6d2af517a 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -218,15 +218,7 @@ See also `diff-mode-read-only-map'." "RET" #'diff-goto-source "" #'diff-goto-source "o" #'diff-goto-source ; other-window - " " #'undo-ignore-read-only - - ;; The foregoing commands don't affect buffers beyond this one. - ;; The following command is the only one that has a single-character - ;; binding and which affects buffers beyond this one. - ;; However, the following command asks for confirmation by default, - ;; so that seems okay. --spwhitton - "u" #'diff-revert-and-kill-hunk - "@" #'diff-revert-and-kill-hunk) + " " #'undo-ignore-read-only) ;; Not `diff-read-only-mode-map' because there is no such mode ;; `diff-read-only-mode'; see comment above. @@ -245,7 +237,18 @@ buffers." "A" #'diff-ediff-patch "r" #'diff-restrict-view "R" #'diff-reverse-direction - "s" #'diff-split-hunk) + "s" #'diff-split-hunk + + ;; The foregoing commands in `diff-mode-shared-map' and + ;; `diff-mode-read-only-map' don't affect buffers beyond this one. + ;; The following command is the only one that has a single-character + ;; binding and which affects buffers beyond this one. However, the + ;; following command asks for confirmation by default, so that seems + ;; okay. --spwhitton + "u" #'diff-revert-and-kill-hunk + ;; `diff-revert-and-kill-hunk' is the `diff-mode' analogue of what '@' + ;; does in VC-Dir, so give it the same short binding. + "@" #'diff-revert-and-kill-hunk) (defvar-keymap diff-mode-map :doc "Keymap for `diff-mode'. See also `diff-mode-shared-map'."