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

"Enter" should select in certain modes #13

Open
countvajhula opened this issue Jul 14, 2022 · 0 comments
Open

"Enter" should select in certain modes #13

countvajhula opened this issue Jul 14, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@countvajhula
Copy link
Owner

Rigpa maps the Enter key to entering a lower level in the current editing tower, overriding the handling in the underlying major mode. In many major modes, there is a more natural interpretation of the Enter key provided by evil-mode or evil-collection for that mode -- e.g. typically non-editing buffers like popups, dired buffers, Magit buffers, etc, where we would like Enter to "visit" or "choose" something. To restore this preferred handling of the Enter key, Rigpa currently manually remaps the Enter key to the preferred command in known cases - in other words, overriding its own override of the keybinding for that major mode - so that the Enter key behaves the way we expect in such buffers.

This is not a real solution. Besides requiring manual work to add these double-overrides (and needing to know about such cases), it also doesn't always work. In Magit, for instance, the same keybindings in different parts of the buffer seem to be bound to different commands (e.g. in the stashes section vs the commits section). I'm not sure how that is accomplished, but it means that a simple manual double-override is not possible here, and Enter does not do what we expect in Magit (workaround: temporarily go to Emacs state (e.g. via C-z) and then hit Enter).

In principle, it would be great if we could simply defer to a lower-priority keymap. That is, in resolving a keybinding, Emacs has a prioritized list of keymaps, and it consults them in order until a binding for the input keys is found. It would be great if we could say something like "if major mode = Magit, then I abstain from specifying the binding - please continue consulting other keymaps". Otherwise, is there another standard way in Emacs to do something like this?

@countvajhula countvajhula added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant