Allow multiple keymaps in :map argument #1051
Open
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.
This is a reimplementation of #830, released as #1019 but reverted due to lacking copyright assignment. The copyright issue should now be solved as I have signed the Emacs copyright papers.
Sorry for the trouble of requesting a second review. I felt a rewrite was warranted due to discovered loose ends as well as readability.
Noteworthy changes:
:map nil
, which currently causes an error, is now treated as synonymous with:map global-map
.nil
,global-map
, andoverride-global-map
are explicitly disallowed as arguments for:prefix-map
or:repeat-map
. Existing checks here and here may have been intended for this purpose (perhaps mistakenly substitutingmap
for(cadr args)
?). These checks had simply been removed in the original PR as I couldn't make sense of them.A redundant check related to repeat maps has been removed
Original description from #830
This PR augments bind-keys to support passing a list of keymaps as the
:map
argument.When one wants to bind the same key/command pair in multiple keymaps, the current options have some drawbacks:
With the new way, it is possible to avoid duplication and still use
:bind
:Additionally this PR clarifies the documentation of
bind-chords
to reflect that this style is already available for that command.Thanks,
Jacob