branch: elpa/magit
commit 8397a8412a3565c5eac6d0004be4a3d701a8f7bb
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-hunk-section-map: Fix bug inherited from smerge.el
The same bug exists in Emacs 29.1 and later. Fixing this
instance of the bug, only benefits users of older Emacs
releases.
See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75933.
Closes #5300.
---
lisp/magit-diff.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index fa75aaf9743..b4ee8025219 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2128,10 +2128,14 @@ keymap is the parent of their keymaps."
"b" #'magit-smerge-keep-base
"l" #'magit-smerge-keep-lower)
-(defvar-keymap magit-hunk-section-map
- :doc "Keymap for `hunk' sections."
- :parent magit-diff-section-base-map
- (key-description smerge-command-prefix) magit-hunk-section-smerge-map)
+(defvar magit-hunk-section-map
+ (let ((map (make-sparse-keymap))
+ (key (key-description smerge-command-prefix)))
+ (when (key-valid-p key)
+ (keymap-set map key magit-hunk-section-smerge-map))
+ (set-keymap-parent map magit-diff-section-base-map)
+ map)
+ "Keymap for `hunk' sections.")
(defconst magit-diff-conflict-headline-re
(concat "^" (regexp-opt