Convert monet-command-map into a prefix map - #41
Open
lina-bh wants to merge 1 commit into
Open
Conversation
A prefix map may be bound to any key in any map to activate those binds. The user may then bind `monet-command-map' to any key they wish, reducing the need for `monet-mode' (stevemolitor#38).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A prefix map may be bound to any key in any map to activate those binds. The user may then bind
monet-command-mapto any key in any map they wish, reducing the need formonet-mode(#38).We can use
defvar-keymaphere, as it was introduced in Emacs 29.1 and we already require Emacs 30.1. We could probably changemonet--make-mode-mapto usedefine-keymap, but it likely wouldn't handle the situation wheremonet-prefix-keyis nil. A more complete solution would be to copy the behaviour of outline.el, which defines adefcustom :setfunction which removes the old keybind and sets the new one, but this would be a breaking change for users who are setting the variable withsetqand notsetoptor Customize.Besides
defvar-keymapanddefine-keymap, the docstring fordefine-keyin my Emacs 31.0.90 pretest says that it is a legacy function and to preferkeymap-set. It's probably impossible for them to get rid of the old functions, but it may be worth going through and replacing them.