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

What is <remap> in minibuffer? #592

Open
Esnos33 opened this issue May 6, 2024 · 3 comments
Open

What is <remap> in minibuffer? #592

Esnos33 opened this issue May 6, 2024 · 3 comments

Comments

@Esnos33
Copy link

Esnos33 commented May 6, 2024

Hi, what does <remap> key mean in minibuffer? I can't find any information about it outside this issue #481
image

@zikajk
Copy link

zikajk commented Jul 28, 2024

Have you found something out meanwhile?

@Esnos33
Copy link
Author

Esnos33 commented Aug 1, 2024

@zikajk I didn't find anything in meow github, but in emacs you can encounter when you are reading keymap. For example, when you run M-x describe-keymap ENTER meow-keymap, the new buffer will open with i formation
<remap> <describe-key> meow-describe-key meaning if I would press key that normaly runs "describe-key" command, you will run "meow-describe-key" command.

@ahan98
Copy link

ahan98 commented Aug 16, 2024

I found this pretty annoying as well, since it persists across all meow-keypads.

The issue might be related to the function meow--keypad-get-keymap-for-describe (note that in meow-keymap.el, meow-keymap is initialized to a keymap which creates a keybinding for [remap describe-key], but modifying the definition to initialize an empty keymap didn't fix the issue). Indeed, evaluating (meow--keypad-get-keymap-for-describe) returns a keymap definition which includes (remap keymap (self-insert-command . undefined)).

It doesn't look like <remap> actually does anything useful, so the code base could probably be updated to directly remove any call to remap. But just in case it's there for some under-the-hood reason, a simple and safe solution is to just remove it from the keypad just before it's displayed:

(defun advice-remove-meow-remap (orig-fun &rest args)
  "Advice to remove the remap entry from the keymap returned by foo."
  (let ((keymap (apply orig-fun args)))
    (if-let ((remap (assq 'remap keymap)))
        (delq remap keymap)
      keymap)))

(advice-add #'meow--keypad-get-keymap-for-describe :around #'advice-remove-meow-remap)

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