meow
meow copied to clipboard
Single-letter keybindings don't work when an input method is active
Minimal init.el:
(add-to-list 'load-path "~/.config/emacs/elpa/meow-20220629.520")
(set-input-method 'russian-computer)
(require 'meow)
(meow-normal-define-key '("j" . meow-next))
(meow-global-mode 1)
Steps to reproduce:
- Run emacs.
-
C-x b *scratch*
-
j
works as expected if the input method is inactive. Once it is activated withC-\
, pressingj
raises an error "о in undefined".
Expected behavior: j
works both when the input method is active and it is not.
Well, when the input method is activated, the input event will be sent to the input method first. And the input method maybe translate the event, may not.
A few options here:
- Check if the input method provides a way to specifying whether the translation should be enabled or not.
- Use the hooks provided by Meow, to activate / deactivate the input method.
I noticed that in modalka-mode it works well. Maybe due to this line:
(advice-add 'quail-input-method :around #'modalka--input-function-advice)
but I'm not sure.
Yep, you can have something like this. If not (meow-insert-mode-p)
, then return the input itself, otherwise call the input method function.