meow
meow copied to clipboard
What is `<remap>` in minibuffer?
Hi, what does <remap>
key mean in minibuffer? I can't find any information about it outside this issue https://github.com/meow-edit/meow/issues/481
Have you found something out meanwhile?
@zikajk I didn't find anything in meow github, but in emacs you can encounter <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.
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)