Skip to content

adds the meow-keypad-key-undefined-function option - #804

Merged
DogLooksGood merged 2 commits into
meow-edit:masterfrom
politza:master
Nov 18, 2026
Merged

DogLooksGood merged 2 commits into
meow-edit:masterfrom
politza:master

Conversation

@politza

@politza politza commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

This adds a new user-option in form of a function. The function is called whenever a key is entered in keypad mode that has no defined binding. This allows to implement a prefix-help-command behavior.

I'm currently experimenting with using embark:

(setq meow-keypad-key-undefined-function
      #'meow-keypad-prefix-help-command)

(defun +meow-keypad-prefix-help-command (key-sequence)
  (if (not (string-suffix-p
            (single-key-description help-char)
            key-sequence))
      (message "%s is undefined" key-sequence)
    (let* ((prefix (replace-regexp-in-string "\\`\\(.+\\) .+\\'" "\\1" key-sequence))
           (keymap (keymap-lookup
                    (make-composed-keymap
                     (current-active-maps t))
                    prefix)))
      (embark-bindings-in-keymap (define-keymap prefix keymap)))))

@DogLooksGood
DogLooksGood merged commit f9612a1 into meow-edit:master Nov 18, 2026
10 of 14 checks passed
@DogLooksGood

Copy link
Copy Markdown
Collaborator

It looks good! Thanks!

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