Accented characters in emacs
Emacs is a pretty good editor. Recently I’ve been hosting a traditional music show and I find myself needing to type accents for Irish and Scottish. This is of course in addition to the french accents I’ve been needing for years.
I use the Mac OS X Terminal application and the system lets me enter accents using dead keys. I hold option and press e to set up an acute accent, then press e again and get é.
This worked in the shell, but did not work in emacs. Now, emacs has lots of different ways to do its own keyboard entry, but I wanted my mac keys to work.
To complicate matters, I use emacs on at least one machine running FreeBSD 4 which does not support UTF-8 encodings (the mac default).
I have had success with the following combination:
- Emacs 21.4 (version 20 does not work)
- locale set to en_CA.ISO8859-1
- Escape non-ASCII characters off (Terminal window setting)
- Character Set Encoding: Western ISO Latin 1 (Terminal window setting)
- Use option key as meta key off (Terminal window setting)
- (set-terminal-coding-system 'iso-latin-1) in ~/.emacs
- (set-keyboard-coding-system 'iso-latin-1) in ~/.emacs
Now I can type and paste accented text into the terminal application and thence into emacs. The accents come through OK and seem to save and email OK too!
|