Add key-seq-define-evil for evil-mode state-aware key sequences - #6
Open
zzeitt wants to merge 2 commits into
Open
Add key-seq-define-evil for evil-mode state-aware key sequences#6zzeitt wants to merge 2 commits into
zzeitt wants to merge 2 commits into
Conversation
added 2 commits
September 18, 2024 15:57
Enable lexical-binding and switch key-seq-define-evil from the `evil-define-key` macro to the `evil-define-key*` function form. `evil-define-key` expands to a `boundp` check on the keymap argument; with lexical-binding a lexically scoped parameter is invisible to `boundp`, so the binding was deferred to `after-load-functions` and never applied. `evil-define-key*` binds immediately.
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.
Add
key-seq-define-evil, a state-aware variant ofkey-seq-definefor evil-mode.It defines an ordered two-key sequence in a specific evil state's keymap, e.g.:
Unlike
key-seq-define, the binding goes through evil'sevil-define-key*, so the chord is only active in the given state(s).Changes:
evilas a package dependency and(require 'evil).key-seq-define-evil(state keymap keys command).evil-define-key*function form instead of theevil-define-keymacro. The macro defers viaafter-load-functionswhen the keymap argument is lexically scoped (boundpcan't see lexical bindings), so bindings were never applied; the function form binds immediately.