Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify keymaps such as `ediff-mode-map' which loads at a later stage #59

Closed
terlar opened this issue Jun 21, 2017 · 2 comments
Closed

Comments

@terlar
Copy link

terlar commented Jun 21, 2017

Is there a recommended keymaps such as this, I searched and read through the documentation, but couldn't find any example like that.

Currently I do like this:

(add-hook 'ediff-keymap-setup-hook
          #'(lambda ()
              (general-define-key
               :keymaps 'ediff-mode-map
               "d" '(ediff-copy-both-to-C      :which-key "Copy both to C")
               "j" '(ediff-next-difference     :which-key "Next difference")
               "k" '(ediff-previous-difference :which-key "Previous difference"))))

But it would be nice not to have the hook wrapping, if general-define-key could handle it somehow. If I define the keys directly on the keymap they don't seem to take affect, probably due to the way ediff sets up it's own keymaps.

@noctuid
Copy link
Owner

noctuid commented Oct 30, 2017

It looks like ediff-mode-map is a local keymap that is reset and set up every time an ediff command is run. There is no way around this; you have to use a hook. I agree this isn't ideal. I'd suggest making a bug report and asking that they add a keymap that the user can make keybindings in that won't be overriden.

@noctuid noctuid closed this as completed Oct 30, 2017
@terlar
Copy link
Author

terlar commented Oct 30, 2017

Thanks for the suggestion, that sounds reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants