Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keypad fails on leader map with Which-Key popup visible #694

Closed
45mg opened this issue Dec 11, 2024 · 5 comments
Closed

Keypad fails on leader map with Which-Key popup visible #694

45mg opened this issue Dec 11, 2024 · 5 comments

Comments

@45mg
Copy link
Contributor

45mg commented Dec 11, 2024

After 8ae8b2c, pressing any key under the leader keymap (as defined in meow-keymap-alist, mode-specific-map by default) when the Which-Key popup is showing will result in '<key> is undefined'.

Reproducing

  1. Clone the meow repo, and add the following to a file my-setup.el in the repo directory:
(require 'meow)
(setq package-user-dir "~/deleteme") ; don't mess up your existing package dir;
                                    ; remove this dir if running the test again
(define-key mode-specific-map "e" #'emacs-version)
(meow-global-mode)
  1. Now run emacs -q -L . -l my-setup.el.

  2. Try SPC e, it will always execute emacs-version, as expected.

  3. Now, do M-x package-install which-key RET, M-x which-key-mode RET.

  4. Press SPC, wait for which-key popup to show, then press e. You will get 'e is undefined' error.

  5. Press SPC e quickly, without waiting for the popup to show. emacs-version is executed.

Workaround(?!)

For some reason, setting meow-keypad-leader-dispatch to "C-c" seems to fix the issue. But I have no idea how or why this works or what the side effects of it might be.

Possibly related

#691 - note that same workaround seemed to work
#686 (comment) - again, same workaround

@DogLooksGood
Copy link
Collaborator

DogLooksGood commented Dec 11, 2024

I can reproduce this issue. It's broken with which-key, but works with the builtin popup.

@DogLooksGood
Copy link
Collaborator

I think it's because how keymap leader is handled.

The leader can either be a keymap or a key sequences. When it's a keymap, we used to raise the priority of that keymap by setting it as overriding-local-map. It used to work because each keypad input is a individual command, now it conflicts with which-key. I just updated how it's handled. Now we lookup this keymap directly instead of raising its priority.

Try the latest commit.

@DogLooksGood
Copy link
Collaborator

Now a remaining problem is I disabled the C-h binding in which-key in meow-shims.el because it affects how meow lookup the C-h binding in keypad. Maybe we could have a work around.

@ircurry
Copy link

ircurry commented Dec 11, 2024

I have tried the latest commit (57e2c29) and the issue I described in #691 has been fixed.

@45mg
Copy link
Contributor Author

45mg commented Dec 14, 2024

Try the latest commit.

Yep, seems to be fixed on or before f74017c.

@45mg 45mg closed this as completed Dec 14, 2024
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

No branches or pull requests

3 participants