Wednesday, July 14, 2010

Hebrew and BiDi text in Emacs24 - Part 2 (Hebrew Input Methods)

In my previous post, I described the Hebrew and BiDi support available in Emacs24 (currently, development version only). As I mentioned in that post, BiDi support is built into Emacs but there are several alternatives for actually entering Hebrew text and Emacs "input methods" are probably the preferred means most Emacs users will use. Although Emacs24 comes with a Hebrew input method (based on the keyboard layout used on Israeli keyboards), I use my own custom Hebrew keyboard layout and I have added that layout to Emacs as a custom input method. The keyboard layout is described on my Hebrew-ZC Keyboard Layout page; however, I'll summarize my rationale for creating a custom Hebrew keyboard layout here as well:

  1. I am a fast English touch-typist and only type Hebrew occasionally. Therefore, I prefer a layout that attempts to match Hebrew letters to English phonetic equivalents. This lets me make reuse my "finger muscle memory" ( when typing Hebrew. I don't want to learn a completely new keyboard layout that I will only use for the occasions that I type in Hebrew.
  2. I want to keep punctuation, special characters, and numbers on the same keys (as much as possible). Most Hebrew keyboard layouts move special characters and punctuation characters around and this drives me crazy!
  3. I mostly type Modern Israeli Hebrew (MIH), usually without vowels. But, I also sometimes need to be able to enter vowels, Biblical Hebrew-specific characters, cantillation marks, and accents. Therefore, the keyboard layout should focus on making modern Hebrew fast to type but also make Biblical Hebrew fairly intuitive.

My custom hebrew-zc Emacs input method (along with installation and usage instructions included as comments at the beginning of the code) is here: hebrewzc.el.


If you are more accustomed to using the SIL or Tiro Hebrew keyboard layouts, Yair F. has created a custom hebrew.el file with those keyboard layouts defined as Emacs input methods. The full list of Hebrew keyboard layouts that he supports in that file are: SI-1452, Lyx, Full, Tiro and Sil. For Yiddish, he also supports keyboard layouts for: Royal (Based on Royal Yiddish typewriter) and Keyman (Phonetic qwerty). Remember: for any Emacs input method, you can use 'M-x describe-input-method' to see the keyboard layout.

For a full description of input methods, refer to the Emacs24 info documentation from within Emacs: 'C-h i m emacs g input'.