Expand description
emacs-keys-mode — a default-on builtin minor mode contributing an
emacs-style <C-x> leader (a tribute layer). Design:
docs/dev/architecture/emacs-keys.md; sequencing:
docs/dev/operations/slice-plans/emacs-keys.md.
§Home (BC.5, 2026-06-23)
Moved here from lattice-host and reclassified as a builtin mode: it
is default-on + Universal, has no owning feature crate, and is
renderer-agnostic — so it belongs with the foundation modes in
lattice-mode (registered via register_foundation_modes). All the
keymap-trie types its layer builder needs (KeymapTrie / BoundCommand /
KeymapLayer from lattice-keymap, ChordPattern from lattice-protocol,
CommandRegistry / CommandInvocation from lattice-grammar) live below
lattice-mode, so the whole module moves. The host retains only the
keymap-layer push (it owns the live KeymapHandle + reads config for
the prefix / enable flag), calling emacs_keys_layer_bindings here.
§Shape
A marker minor mode (Guard = ()) with ActivationPolicy::Universal, so
it auto-activates on every buffer. Its keymap layer is pushed once at boot
under MinorMode(emacs-keys-mode); K.1.c’s per-keystroke filter gates the
chords to buffers where the mode is active — the diff-mode pattern.
§Configurable prefix
Every binding’s chord is prefix + suffix, parsed as one key sequence
([lattice_protocol::parse_chord_sequence]). The prefix defaults to
"<C-x>"; rebuilding the layer with a different prefix re-targets the
whole tribute. A malformed prefix (user config) or an unknown command
name skips that one binding with a warning — never a panic on the boot
path (graceful-degradation contract).
Structs§
- Emacs
Keys Mode - The
emacs-keysminor mode. A marker mode: it owns a keymap layer and an activation policy, but allocates no per-buffer resources.
Functions§
- emacs_
keys_ layer_ bindings - Build the
emacs-keyskeymap layer for the givenenabledflag andprefix, resolving each binding’s command name againstregistry. Returns the per-mode trie map the host pushes underMinorMode(emacs-keys-mode). - register_
emacs_ keys_ mode - Register
emacs-keys-modeagainstregistry. Called fromregister_foundation_modes— it is a builtin, so there is no separate boot call.