Skip to content

Conversation

@cxxxr
Copy link
Member

@cxxxr cxxxr commented Jan 7, 2026

Summary

  • Add meta-prefix-keys editor variable to treat keys as Meta prefix without timeout
  • When enabled, pressing a prefix key followed by another key produces Meta+key immediately
  • Pressing the same prefix key twice produces the prefix key itself
  • Implemented in core layer, works across all frontends

Supported configurations

;; Use Escape as Meta prefix (simplest)
(setf (lem:variable-value 'lem:meta-prefix-keys :global) t)

;; Use a specific key as Meta prefix
(setf (lem:variable-value 'lem:meta-prefix-keys :global)
      (lem:make-key :ctrl t :sym ";"))

;; Use multiple keys as Meta prefix
(setf (lem:variable-value 'lem:meta-prefix-keys :global)
      (list (lem:make-key :sym "Escape")
            (lem:make-key :ctrl t :sym ";")))

Behavior

Input Output
Escape x M-x
Escape Escape Escape
Escape C-c M-C-c

Test plan

  • Unit tests for keys-equal-p, meta-prefix-key-p, add-meta-modifier, maybe-convert-to-meta
  • Test: t (Escape) as prefix
  • Test: Custom key as prefix
  • Test: Multiple prefix keys
  • Test: Double-press produces the prefix key itself
  • Test: Non-prefix keys pass through unchanged
  • All 12 tests passing

🤖 Generated with Claude Code

Add `escape-as-meta-prefix` editor variable that treats Escape key as
Meta prefix without timeout delay. When enabled:
- Escape followed by any key produces Meta+key (e.g., Esc x → M-x)
- Escape Escape produces a single Escape (for quit)

This provides an alternative to the existing ncurses timeout-based
escape handling, allowing users who prefer immediate key processing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lem-project lem-project deleted a comment from code-contractor-app bot Jan 7, 2026
Rename `escape-as-meta-prefix` to `meta-prefix-keys` and extend to
support arbitrary keys as Meta prefix:

- nil: disabled
- t: use Escape as Meta prefix (convenient shorthand)
- a key object: use that specific key as Meta prefix
- a list of keys: use any of those keys as Meta prefix

This allows users to configure custom Meta prefix keys, such as
using both Escape and other keys for Meta input.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cxxxr cxxxr changed the title feat(input): add escape-as-meta-prefix for timeout-free Meta input feat(input): add meta-prefix-keys for flexible Meta input Jan 7, 2026
@cxxxr cxxxr merged commit b204f8e into main Jan 7, 2026
11 checks passed
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.

2 participants