Typing Persian in Emacs

A gentleman need not know Persian, but he should at least have forgotten it. And to learn it you have to type it. You could change your computer’s input method, or buy a Persian keyboad, but it’s inconvenient.

Emacs has an input method layer separate from the operating system’s. For typing Persian there’s two choices:

  1. farsi-isiri-9147 implements ISIRI 9147, the keyboard layout used in Iran.
  2. farsi-transliterate-banan, by Mohsen Banan, gives you a natural mapping of a QWERTY keyboard to Persian.

You enable the latter with:

M-x set-input-method RET farsi-transliterate-banan RET

And disable it with:

M-x toggle-input-method

The mapping is very natural: b gives ب, p gives پ, s gives س. There are also digraphs: ch gives چ and sh gives ش.

My only objection is that q gives غ, while gh gives ق, which is contrary to what I’d expect, but acceptable.

You can figure it out by trial and error, but I wanted a convenient cheatsheet, so here it is:

1

۱

2

۲

3

۳

4

۴

5

۵

6

۶

7

۷

8

۸

9

۹

0

۰

q

غ

ق

w

ع

ء

e

ِ

ٍ

r

ر

R

t

ت

ط

y

ی

ي

u

و

ٓ

i

ی

ئ

o

ُ

ٌ

p

پ

P

a

ا

آ

s

س

ص

d

د

ٱ

f

ف

إ

g

گ

غ

h

ه

ح

j

ج

k

ک

ك

l

ل

L

z

ز

ذ

x

ض

ظ

c

ث

ٕ

v

و

ؤ

b

ب

B

n

ن

«

m

م

»

The bottom left is lowercase, the bottom right is uppercase.

And the digraphs:

Input Output
ch چ
kh خ
zh ژ
sh ش
gh ق