reverse-im.el icon indicating copy to clipboard operation
reverse-im.el copied to clipboard

reverse-im translates a search string used in `avy-goto-char-timer`

Open aragaer opened this issue 1 year ago • 2 comments

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.

aragaer avatar Oct 05 '24 16:10 aragaer

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.

aragaer avatar Oct 05 '24 17:10 aragaer

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))

aragaer avatar Oct 06 '24 19:10 aragaer