1

I sometimes write in my native language (Mongolian). There seems no entry for it in set-input-method.

Should add it from other place / or install some packages?

Drew
  • 75,699
  • 9
  • 109
  • 225
Garid
  • 545
  • 1
  • 13
  • [On Ubuntu] Following advice here https://unix.stackexchange.com/questions/43976/list-all-valid-kbd-layouts-variants-and-toggle-options-to-use-with-setxkbmap I ran `sed '/! variant/,/^$/!d;/Mongolian/!d' < /usr/share/X11/xkb/rules/evdev.lst`. It gave me mon_trad cn: Mongolian (Bichig) mon_trad_todo cn: Mongolian (Todo) mon_trad_xibe cn: Mongolian (Xibe) mon_trad_manchu cn: Mongolian (Manchu) mon_trad_galik cn: Mongolian (Galik) mon_todo_galik cn: Mongolian (Todo Galik) mon_manchu_galik cn: Mongolian (Manchu Galik)` All these should be available in `setxkbmap` – Rusi Jul 15 '22 at 16:18

2 Answers2

4

Update: this has been added to Emacs-29.1 here:


Following this answer to similar question, I made following lines, and added to init.el.

(quail-define-package
    "Mongolian-trans" "Mg-trans" "S>" t
    "Input method for Mongolian transcription."
    nil t nil nil nil nil nil nil nil nil t)

(quail-define-rules
    ;; keys (without shift)
    ("q" ?ф) ("w" ?ц) ("e" ?у) ("r" ?ж) ("t" ?э) ("y" ?н) ("u" ?г)
    ("i" ?ш) ("o" ?ү) ("p" ?з) ("[" ?к) ("]" ?ъ) ("a" ?й) ("s" ?ы)
    ("d" ?б) ("f" ?ө) ("g" ?а) ("h" ?х) ("j" ?р) ("k" ?о) ("l" ?л)
    (";" ?д) ("'" ?п) ("z" ?я) ("x" ?ч) ("c" ?ё) ("v" ?с) ("b" ?м)
    ("n" ?и) ("m" ?т) ("," ?ь) ("." ?в) ("/" ?ю)

    ;; keys (with shift)
    ("Q" ?ф) ("W" ?Ц)  ("E" ?У) ("R" ?Ж) ("T" ?Э) ("Y" ?Н) ("U" ?Г)
    ("I" ?Ш) ("O" ?Ү)  ("P" ?З) ("{" ?К) ("}" ?Ъ) ("A" ?Й) ("S" ?Ы)
    ("D" ?Б) ("F" ?Ө)  ("G" ?А) ("H" ?Х) ("J" ?Р) ("K" ?О) ("L" ?Л)
    (":" ?Д) ("\"" ?П) ("Z" ?Я) ("X" ?Ч) ("C" ?Ё) ("V" ?С) ("B" ?М)
    ("N" ?И) ("M" ?Т)  ("<" ?Ь) (">" ?В) ("?" ?Ю)


    ;; numbers keys (without shift)
    ("1" ?№) ("2" ?-) ("3" ?\") ("4" ?₮) ("5" ?:) ("6" ?.)
    ("7" ?_) ("8" ?,) ("9" ?%)  ("0" ??) ("-" ?е) ("=" ?щ)


    ;; numbers keys (with shift)
    ("!" ?1) ("@" ?2) ("#" ?3) ("$" ?4) ("%" ?5) ("^" ?6)
    ("&" ?7) ("*" ?8) ("(" ?9) (")" ?0) ("_" ?Е) ("+" ?Щ)
)
Garid
  • 545
  • 1
  • 13
  • 2
    Please `M-x report-emacs-bug` with your improvements, so that Emacs will support the Mongolian input method by default in future. – phils Jul 15 '22 at 08:37
2

Does Mongolian look like Russian / Cyrillic?


  1. M-x view-hello-file. (Options → Multilingual Environment → Show Multilingual Sample Text)
  2. Search for Mongolian in that file. You will see an entry like this.
Mongolian (монгол хэл)  Сайн байна уу?
  1. Place the cursor on the mongolian chars, and do C-u M-x describe-char

You will see an entry like the one below. Note that it reports script as cyrillic.

             position: 2799 of 4623 (61%), column: 18
            character: х (displayed as х) (codepoint 1093, #o2105, #x445)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x0445
               script: cyrillic
               syntax: w    which means: word
             category: .:Base, L:Strong L2R, Y:2-byte Cyrillic, c:Chinese, h:Korean, j:Japanese, y:Cyrillic
             to input: type "C-x 8 RET 445" or "C-x 8 RET CYRILLIC SMALL LETTER HA"
          buffer code: #xD1 #x85
            file code: #xD1 #x85 (encoded by coding system utf-8-unix)
              display: by this font (glyph code):
    ftcrhb:-GOOG-Noto Sans CJK KR-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x168)

Character code properties: customize what to show
  name: CYRILLIC SMALL LETTER HA
  old-name: CYRILLIC SMALL LETTER KHA
  general-category: Ll (Letter, Lowercase)
  decomposition: (1093) ('х')

[back]
  1. So you need to setup a cyrillic input method.
  2. So, do M-x set-input-method RET (Options → Multilingual Environment → Select Input Method...) and pick one of the following input methods
cyrillic-tuvan
cyrillic-jcuken
cyrillic-serbian
cyrillic-yawerty
cyrillic-translit
cyrillic-ukrainian
cyrillic-macedonian
cyrillic-jis-russian
  1. Once in cyrillic input, do M-x describe-input-method (Help → Describe → Describe Input Method... and Options → Multilingual Environment → Describe Input Method...)

  2. You switch back to normal input method with M-x toggle-input-method RET (Options → Multilingual Environment → Toggle Input Method)


You can also do Options → Multilingual Environment → Set Language Environment → Cyrillic and set up a specific cyrillic language environment.

You can also do M-x customize-variable RET default-input-method RET , and set it to your preferred input method.

  • Thanks for the detailed reply, Yes, Mongolian use Cyrillic-alphabet. But (Main reason not using other cyrrilic inputs): The keyboard layout was completely different than other Cyrillic inputs. – Garid Jul 15 '22 at 05:13
  • 1
    [image of Mongolian layout](https://upload.wikimedia.org/wikipedia/commons/5/54/Mongolian_keyboard_win.png), . [image of Russian layout](https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/KB_Russian.svg/1280px-KB_Russian.svg.png) – Garid Jul 15 '22 at 05:22
  • 1
    You can ditch emacs altogether, and use whatever method your desktop provides. On `GNOME`, you can use `ibus` method `mongolian`, and it seems to have same mapping as what you have posted. –  Jul 15 '22 at 07:26
  • Mongolian also has two extra letters that are not in Russian and other Cyrillic alphabets, namely ө, ү. –  Jul 15 '22 at 17:26