a13/reverse-im.el

"," is translated to "?" for russian-computer input method

Opened this issue · 5 comments

"," in Russian correspond to Shift+"/" in English qwerty keyboard. As a result, "C-c C-," is translated into "C-c C-?" in English layout as well while it should not. Strangely, "C-c ," still works as expected in English layout.

a13 commented

do you use the translation from "russian-computer" input method?

a13 commented

could you please provide the results of calling M-x describe-key for all that bindings?

  1. Yes, I use "russian-computer" input method.

  2. "C-c ," is binded to org-priority command from org-mode. As for "C-c C-,", I just realized that it is undefined. However, I am using boon-mode, which translates "c ," key sequence into either "C-c C-," or "C-c ,". Normally, I get org-priority called after "c ," since only "C-c ," is defined. The problem is that boon-mode used read-key function to read the key sequence, and, when reverse-im-mode is active, I get function bound to "C-c ?" (org-table-field-info) called instead of org-priority.

  3. Of course, the previous issue is partially thanks to internal implementation of boon-mode. However, the described problem can shoot for other packages as well:
    which-key seems to use the same read-key approach resulting in "C-c ?" (which should show a summary of key bindings) to be translated into "C-c &-" (Russian "?" corresponds to English "&").

  4. I have "C-c C-," undefined in fundamental-mode. When reverse-im is active, it is translated into "C-c C-?". Guess what happen if "C-c C-?" is bound to something and you press "C-c C-,"?

In summary, it looks wrong to translate the symbols, which have same codes in both English and some other language input method, but correspond to different keys on actual keyboard.

P.S. It is a bit out of scope of this particular bug, but I did not manage to make reverse-im work with key-chord-mode. Any advice here?

a13 commented

In summary, it looks wrong to translate the symbols, which have same codes in both English and some other language input method, but correspond to different keys on actual keyboard.

Oh, I see, the thing is I use my own keyboard layout, which has punctuation marks on the same keys in both languages, so I didn't face the problem myself. I'll take a look, ok.

a13 commented

Well, there are several problems

  1. reverse-im translates key even if it is in English keyboard (I fixed this - , will be ,, not a ?)

  2. Emacs knows nothing about system layout, so there's no way to distinguish ? on 7/& key in Russian and ?// key in English, So this one can't be fixed at least using current approach.

  3. As for key-chord.el - it uses its own input-method-function, there's even a comment in the source code:

;; Key chord mode uses input-method-function. And so do internationalisation
;; packages (mule, quail, etc). Do not expect them to work well together.
;; The last one that gets the input-method-function rules.

So i think it's a key-chord issue (well, implementation specific feature).