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

Consider local keybindings when moving commands for the Motion state. #517

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

okamsn
Copy link
Contributor

@okamsn okamsn commented Oct 14, 2023

  • Add the library Compat (https://elpa.gnu.org/packages/compat.html), which makes available the function keymap-local-lookup to Emacs older than 29.1. The new keymap- functions are recommended over older functions like lookup-key.

  • Instead of directly binding H-j to what was bound to j, for example, bind H-j to an interactive lambda which first checks whether there is a local binding for j. If there is, use that. If there is not, then call the orignal command bound to j.

This seems to fix using the overrides in Magit buffers (see #493), where the command bound to H-k seems to be based on where point is located when meow--save-origin-commands is run.

@DogLooksGood
Copy link
Collaborator

Hey, thanks for the contribution.

We want to keep meow free of dependencies, so we don't want to introduce compact library. I guess we can port it if we really need it.

Instead of directly binding `H-j` to what was bound to `j`, for example, bind
`H-j` to an interactive lambda which first checks whether there is a local
binding for `j`.  If there is, use that.  If there is not, then call the orignal
command bound to `j`.

This should fix using the overrides in Magit buffers (see meow-edit#493), where the
command bound to `H-k` seems to be based on where point is located when
`meow--save-origin-commands` is run.
@okamsn
Copy link
Contributor Author

okamsn commented Oct 15, 2023

OK, I've removed the use of Compat and copied the relevant portion of the definition.

This change works for me on Emacs 29.1. What else would you like changed?

@DogLooksGood
Copy link
Collaborator

I'm quite busy these days. Later I'll check the updates and merge.

@norris-young
Copy link

norris-young commented Dec 30, 2023

@DogLooksGood This works for me. Will you merge it?

@DogLooksGood
Copy link
Collaborator

I'll do some test and merge it.

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

Successfully merging this pull request may close these issues.

3 participants