Using Mule to display and enter Japanese Text

The supported application for Japanese text entry on Athena is called mule. Mule is based directly on the widely-available text editor, emacs, and can handle a wide variety of foreign languages, including non-latin character-based ones such as Japanese. It is highly recommended that you know the basics of using emacs before attempting to use mule! If you're not familiar with emacs, you should at least look over the introductory sections of the document Emacs on Athena to get started. Hardcopy versions of the document are available at the MIT Graphic Arts Quick Copy Center in the basement of Building 11.

To start mule on an Athena workstation, type:

add babel
mule filename &

or

bigmule filename &

where you should replace filename with the name of the file you want to edit. (If the file doesn't exist, mule will create an empty file by that name for you.) Similar to kterm, the regular version of mule starts in a 14-point font, and the "big" mule uses a 24 point font.

The mule program works just like emacs and most of the regular emacs commands work inside it. The basic emacs/mule concept to keep in mind is that all interactions (other than just entering text) with the editor require that you type two keys at the same time. The two most-used keys for this are referred to in emacs-lingo as "control" and "meta." The "control" key is labelled "Control" or "Ctrl" on Athena workstations. The "meta" key is labelled "Compose Character" on the DECstations, "Alt" on the RS/6000s, and a black diamond on the Suns.

The commands to move around and quit are:

Once you have the mule window on your screen, you need to start up the Japanese mode. To do this, type:

m-x skk-mode

(That's the meta key plus the x key, followed by the text skk-mode, and then finally hit the return key.)

After a short wait, the "status line" across the bottom of the mule window will change to have the text kana, in
Japanese on the lefthand side. This is the main mode from which you'll do Japanese text entry, called "hiragana mode." In hiragana mode, as you type, mule interprets what you type as romaji according to the following tables.

Basic hiragana:

Voiced hiragana:

Compounds:

For the doubled consonants, simply type the normal romanji:

From hiragana mode, you can also switch to and from katakana mode, to and from regular English text mode, and to and from a "wide" English text mode:

You switch to regular English by typing l (that's the letter "el" not the digit "one") and back to hiragana by typing c-j ("control-j"). Similarly, L will switch you to the "wide English" mode, which consists of English characters with the same aspect ratio as Japanese characters (that is, square,) and c-j switches back. In addition, you can switch between hiragana and katakana with the q key.

Dealing with entering Kanji characters is, necessarily, more complicated. For more details on the Kanji mode in mule, we recommend you run the tutorial program for skk-mode. To invoke it, start up mule and type:

m-x skk-tutorial

and follow the directions from there.

Saving files

There are several different file encoding systems in use today for saving text files with Japanese text in them, and different applications which do things with the files need different file formats. For instance, to send Japanese email you should save in one format, and you'll use a different format to send the file to an Athena printer.

The mule program allows you to set the type of file coding before you save a given file, so you can pick the appropriate one for the end purpose of the file (sending as email, printing, etc.) Luckily, mule itself is pretty smart, and will figure out how to read just about any of the various file formats on its own, so you don't need to worry about what format a file is in before you bring it up in mule.

To set the file coding system for a particular file you want to save, bring the file up in mule and type:

m-x set-file-coding-system

and then hit the Return key. Then type one of the system types from the following table, as needed:

If you want to:                  Type this:
view the file with kterm         *oldjis*
print the file                   *internal* or *junet*
use the file on the Web          *junet*

This encoding change will take effect the next time you save the file. So, if you have not made any changes to the file since you last saved it, you will have to make some change (just add an extra space somewhere, or something innocuous) in order for the file to be saved out in the new format.

Printing text files

You can print files in Japanese on Athena which have been saved in either the Mule internal format, or the "junet" format as described in the Saving files section above. The command is:

add nihongo
jlpr filename

where filename is the name of the file you wish to print. Just like the regular lpr command on Athena, you can specify the name of the printer with the -P option, etc. (See man lpr for more information on printing from Athena.


[Back to the main Help page]