0

When I switch to Cyrillic input method (by pressing C-\), the / key starts to act as a prefix to enter extended characters.

For example:

  • /o -> њ
  • /a -> ќ
  • /y -> ї

etc...

Is there a way to disable this behavior? I'd prefer to switch it off permanently for all modes, so pressing the / always enters the same character independently of what I typed after it.

Drew
  • 75,699
  • 9
  • 109
  • 225
Max Arnold
  • 103
  • 3

1 Answers1

2

I assume you mean the cyrillic-translit input method.

The supported way is to identify each binding with a slash as prefix by looking at quail/cyrillic.el and unbind it individually:

(quail-defrule "/d" nil "cyrillic-translit")
[...]
(quail-defrule "/t" nil "cyrillic-translit")

The unsupported way is to look at quail's code to perform introspection on the input method, find where the slash is defined in its keymap and unset it:

(quail-select-package "cyrillic-translit")
(dolist (binding (cdr (quail-map)))
  (when (= (car binding) ?/)
    (setcdr binding nil)))

To defer evaluation of that code inside your init file:

(with-eval-after-load "leim/quail/cyrillic"
  (quail-select-package "cyrillic-translit")
  (dolist (binding (cdr (quail-map)))
    (when (= (car binding) ?/)
      (setcdr binding nil))))

One last issue with this is that there doesn't seem to be any supported way of temporarily working with a quail package. Whether that is a problem in practice, you tell me.

wasamasa
  • 21,803
  • 1
  • 65
  • 97
  • Yes, you are absolutely correct. I have `(setq default-input-method 'cyrillic-yawerty)` in my `init.el` with a couple of customizations – Max Arnold Jan 26 '21 at 10:20
  • I successfully unbinded them one-by-one, because the first `qual-select-package` snippet had no effect for me (I tried to evaluate it in a temporary buffer). Thanks a lot! – Max Arnold Jan 26 '21 at 10:41
  • It only worked for me once the method has been defined. For example after evaluating the `with-eval-after-load` block, then using `C-\\` to load the input method. – wasamasa Jan 26 '21 at 11:02