emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit 139f603cb8: magit-hunk-section-map: Honor smerg


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 139f603cb8: magit-hunk-section-map: Honor smerge-command-prefix again
Date: Tue, 10 Oct 2023 10:01:25 -0400 (EDT)

branch: elpa/git-commit
commit 139f603cb85e57baf0e3c657bc3d4860af3a9544
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-hunk-section-map: Honor smerge-command-prefix again
    
    We stopped doing that in [1: deb10e984e] without providing an
    explanation.
    
    I am undecided whether honoring/hi-jacking this variable is
    appropriate.  Its docstring says that it concerns `smerge-mode'
    commands, but our `magit-smerge-*' commands are used in `magit-*-mode'
    buffers.  It is likely that a user would want to change the prefix in
    both keymaps; but if they don't, then the undocumented side-effect is
    confusing.
    
    Additionally I have reservations about such variables in the first
    place.  They make certain very specific, customization slightly
    easier, at the cost of making widespread binding changes harder.
    
    I am going back to using this variable in this context, to revert
    a change in behavior, but if we had never done this before, then
    I would most likely reject a proposal to start doing so now.
    
    Closes #5021.
    
    1: 2023-02-13 deb10e984e16201182b0569f7df7d30ec3b8afa9
       Use defvar-keymap for keymaps containing context menus
---
 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 f478d0e1b0..95daa7b6a8 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2088,13 +2088,17 @@ keymap is the parent of their keymaps."
   :doc "Keymap for `file' sections."
   :parent magit-diff-section-base-map)
 
+(defvar-keymap magit-hunk-section-smerge-map
+  :doc "Keymap bound to `smerge-command-prefix' in `magit-hunk-section-map'."
+  "RET" #'magit-smerge-keep-current
+  "u"   #'magit-smerge-keep-upper
+  "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
-  "C-c ^ RET" #'magit-smerge-keep-current
-  "C-c ^ u"   #'magit-smerge-keep-upper
-  "C-c ^ b"   #'magit-smerge-keep-base
-  "C-c ^ l"   #'magit-smerge-keep-lower)
+  (key-description smerge-command-prefix) magit-hunk-section-smerge-map)
 
 (defconst magit-diff-conflict-headline-re
   (concat "^" (regexp-opt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]