reverse-im.el
reverse-im.el copied to clipboard
reverse-im translates a search string used in `avy-goto-char-timer`
When trying to jump to a non-latin string using avy-goto-char-timer I am typing cyrillic characters but those are translated by reverse-im. Functions like avy-goto-char-timer use two separate calls to read-char, one is used to read the search string in avy--read-candidates function and that one should not be affected by reverse-im. The other call in avy--process-1 should be translated.
The following works
(advice-add #'avy--read-candidates :around
(defun +suppress-reverse-im (fn &rest r)
(advice-remove 'read-char reverse-im-read-char-advice-function)
(unwind-protect
(funcall fn r)
(advice-add #'read-char:around reverse-im-read-char-advice-function))))
I hope there is a more sane way to temporarily disable reverse-im.
it seems that avy-goto-char-timer itself works correctly, but any custom function that uses it doesn't. For example
(defun my-goto-char-timer ()
(interactive)
(avy-goto-char-timer))