Skip to content

Fix key-seq bindings silently ignored by key-chord optimization#5

Open
lewang wants to merge 3 commits intovlevit:masterfrom
lewang:register-chord-keys
Open

Fix key-seq bindings silently ignored by key-chord optimization#5
lewang wants to merge 3 commits intovlevit:masterfrom
lewang:register-chord-keys

Conversation

@lewang
Copy link

@lewang lewang commented Feb 21, 2026

key-seq-define fell out of sync with key-chord-define in two ways:

  1. Key tracking — key-chord's input method now skips chord detection for keys not registered via key-chord-register-keys (Improve performance, add typing detection emacsorphanage/key-chord#12). key-seq-define never called this, so key-seq bindings could be silently ignored. Call key-chord-register-keys/key-chord-unregister-keys after defining/removing a binding, guarded with fboundp for backward compatibility.

  2. Key validation — Replace the old logand 255 masking (which silently truncated invalid keys) with explicit type and range checking, matching key-chord's current validation.

Also enable lexical-binding, which the file was missing.

key-chord has an optimization where the input method skips chord
detection for keys not registered in any chord.  key-seq-define was
not calling key-chord-register-keys, so defined sequences could be
silently ignored.  Call register/unregister to keep the two packages
in sync.
@lewang lewang force-pushed the register-chord-keys branch from b2b8f74 to f7e2712 Compare February 21, 2026 11:51
Le Wang added 2 commits February 21, 2026 06:53
Silence native-compiler warnings for key-chord-register-keys and
key-chord-unregister-keys which are called conditionally via fboundp.
@lewang lewang force-pushed the register-chord-keys branch from f7e2712 to 3b39d74 Compare February 21, 2026 11:53
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.

1 participant