Skip to content

Convert monet-command-map into a prefix map - #41

Open
lina-bh wants to merge 1 commit into
stevemolitor:mainfrom
lina-bh:prefix-keymap
Open

Convert monet-command-map into a prefix map#41
lina-bh wants to merge 1 commit into
stevemolitor:mainfrom
lina-bh:prefix-keymap

Conversation

@lina-bh

@lina-bh lina-bh commented Jul 19, 2026

Copy link
Copy Markdown

A prefix map may be bound to any key in any map to activate those binds. The user may then bind monet-command-map to any key in any map they wish, reducing the need for monet-mode (#38).

We can use defvar-keymap here, as it was introduced in Emacs 29.1 and we already require Emacs 30.1. We could probably change monet--make-mode-map to use define-keymap, but it likely wouldn't handle the situation where monet-prefix-key is nil. A more complete solution would be to copy the behaviour of outline.el, which defines a defcustom :set function which removes the old keybind and sets the new one, but this would be a breaking change for users who are setting the variable with setq and not setopt or Customize.

Besides defvar-keymap and define-keymap, the docstring for define-key in my Emacs 31.0.90 pretest says that it is a legacy function and to prefer keymap-set. It's probably impossible for them to get rid of the old functions, but it may be worth going through and replacing them.

A prefix map may be bound to any key in any map to activate those binds. The
user may then bind `monet-command-map' to any key they wish, reducing the need
for `monet-mode' (stevemolitor#38).
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