Previous Next Contents

8. Miscellaneous utilities setup

Generally, to set the certain utility up to handle the Cyrillic requires just to allow the 8 bit input. In some cases it is required to tell the application to show the extended ASCII characters in their "native" form.

8.1 bash

Three variables should be set on order to make bash understand the 8-bit characters. The best place is ~/.inputrc file. The following should be set:

set meta-flag on
set convert-meta off
set output-meta on

8.2 csh/tcsh

The following should be set in .cshrc:

setenv LC_CTYPE iso_8859_5
stty pass8

If you don't have the POSIX stty (impossible for Linux), then replace the last call to the following:

stty -istrip cs8

8.3 emacs

The minimal cyrillic support in emacs is done by adding the following calls to one's .emacs (provided that the Cyrillic character set support is installed for console or X respectively):

(standard-display-european t)

(set-input-mode (car (current-input-mode))
   (nth 1 (current-input-mode))
   0)

This allows the user to view and input documents in Russian.

However, such mode is not of a big convenience because emacs doesn't recognize the usual keyboard commands while set in Cyrillic input mode. There are a number of packages which use the different approach. They don't rely on the input mode stuff established by the environment (either X or console. Instead, they allow the user to switch the input mode by the special emacs command and emacs itself is responsible for re-mapping the character set. The author took a chance to look at three of them. The russian.el package by Valery Alexeev (ava@math.jhu.edu) allows the user to switch between cyrillic and regular input mode and to translate the contents of a buffer from one Cyrillic coding standard to another (which is especially useful while reading the texts imported from MS-DOG).

The only inconvenience is that emacs is still treating the russian characters as special ones, so it doesn't recognize russian words' bounds and case changes. To fix it, you have to modify the syntax and case tables of emacs:

;; there is a garbage in the variables below, since SGML doesn't like
;; cyrillic characters. You have to put the uppercase and lowercase
;; parts of the Russian alphabet respectively (see the actual files)

(setq *russian-abc-ucase* "*** SGML SUCKS ***")
(setq *russian-abc-lcase* "*** SGML SUCKS ***")


(let ((i 0)
      (len (length *russian-abc-ucase*)))

     (while (< i len)
       (modify-syntax-entry (elt *russian-abc-ucase* i) "w  ")
       (modify-syntax-entry (elt *russian-abc-lcase* i) "w  ")
       (set-case-syntax-pair (elt *russian-abc-ucase* i)
                             (elt *russian-abc-lcase* i)
                             (standard-case-table))
       (setq i (+ i 1))))

For this purpose I created a rusup.el file which does this, as well as a couple handy functions. You have to load it in your ~/.emacs.

Another alternative is the package remap which tries to make such support more generic. This package is written by Per Abrahamsen (abraham@iesd.auc.dk) and is accessible at ftp.iesd.auc.dk.

As for the author's opinion, I would suggest to start using the russian.el package because it is very easy to setup and use.

8.4 ispell

There is an rspell add-on created by Neal Dalton (nrd@cray.com) for the GNU ispell package, but I experienced some problems making it work right away. Try it - maybe you will be luckier.


Previous Next Contents