Working with ATF in Emacs using atf-mode

An Emacs major mode is available which makes editing ATF files a bit easier and gives access to the template generator and checker.

Obtaining Emacs

Downloading and Installing

  1. Download the Emacs lisp files in the archive atf-mode.zip.
  2. Unzip the archive to extract the files in the directory or folder where you want them to live:
    • for Unix and Mac OS X it is simplest to extract into your home directory.
    • on Windows XP EmacsW32 considers the home directory to be (for user 's') c:\Documents and Settings\s\Application Data.
  3. Locate your .emacs file; this will be in your home directory and it may be hidden. It is possible that it may not exist, if your Emacs installation creates it on demand when needed to store configuration options. To locate this file it is easiest to use Emacs: type ctrl-x ctrl-f and enter the filename as ~/.emacs. If the file does not exist, Emacs will create it.
  4. Edit your .emacs file to include the following line:
    (load-file "~/cdl-init.el")
    
    (The file name will be different if you do not extract the files to your home directory or Application Data under Windows).
  5. Save your .emacs, exit Emacs and restart.

Using ATF mode

If you name your files using the extension .atf, Emacs will automatically switch into ATF mode when you create a new file or load an existing one.

If you name your files using another extension, for example .txt, you can set the mode explicitly by typing Esc-x (escape then x) and then entering atf-mode at the prompt.

You can now use the ATF menu to read the ATF mode help, which will in turn tell you how to use the other menu items effectively.

Creating New Transliterations

  1. Use menu File Visit new file to open a new file
  2. If your new file does not have a .atf extension, enter ATF mode manually
  3. Enter a template specification in your new file; you can access the template help from the ATF menu
  4. When you have completed your template, select menu Create Template
  5. Review the block structure you have created; if is incorrect, use the undo function to remove the block structure, edit the template specification and recreate the template
  6. When you are satisfied with your template, delete the template specification

Using the Checker

Although you can use the menu, there are two particularly useful keystrokes for working with the checker:

C-c-C-c
This is control-c then control-c again. This runs the checker and displays the results in another window.
C-c-C-n
This is control-c then control-n. This moves the cursor to the next erroneous line in your ATF file (it is often easier to use this key than C-x-`, which is the mainstream key-binding for the next-error command.

Troubleshooting

Checker fails on Windows with strange '&P123456' results

Check the XML-RPC Customization option 'Xml Rpc Allow Unicode String': if it is not set to 'nil', then set it to 'nil' and try again.

(To find this option, try Options -> Customize Emacs -> Settings Matching Regexp and type xml-rpc-* at the prompt.)

Entering Unicode Characters

The Emacs ATF package includes an input method which is based on the Emacs MULE TeX input method but adds some characters which are useful for cuneiform transliterations. If the ATF mode package is installed correctly this input method is available under the name 'Cuneiform'.

To use this input method:

  1. Choose Options -- Mule -- Set Language Environment -- UTF-8; you will now see a lowercase 'u' at the left end of the Emacs status line
  2. Choose Options -- Mule -- Select Input Method and then type 'Cuneiform' at the prompt
  3. Use control-backslash (\) to switch the Cuneiform input method on and off; when the method is enabled you will see a backslash at the left end of the status line

Keyboard Sequences in Cuneiform Input Method

The Cuneiform transliteration input method is based on control sequences used by the typesetting package TeX, with some additions. In general these sequences start with the backslash character, followed by an accent character, then the character that will receive the accent. These sequences are notated as, e.g., \-v-s in the following table (meaning, in this case, that you type the backslash, then v, then s, which gives you shin, š).

Note that the table below restricts the list of available characters to those needed for cuneiform transliteration; many more characters are available following the same principles.

See also the Unicode for cuneiform transliteration page and the fonts page. If you don't see the subscript x character you probably need to update to the latest fonts.

Sequence Accent Name Available for: Results:
\-'AcuteaeiuAEIUsSáéíúÁÉÍÚśŚ
\-`GraveaeiuAEIUàèìùÀÈÌÙ
\-=MacronaeiuAEIUāēīūĀĒĪŪ
\-^CircumflexaeiuAEIUâêîûÂÊÎÛ
\-vHacheksSšŠ
\-dDot-undersStTṣṢṭṬ

Several other characters are provided using the following sequences:

\-h , \-Hḫ , Ḫ
\-j , \-Jŋ , Ŋ
\-[ , \-]˹ , ˺
\-_[ , \-_]⸤ , ⸥

(Note that lower left/right square brackets are not used in ATF; they are provided for use in citing published work.)

A few characters require typing a word after the backslash:

\times×
\alefʾ
\ayinʿ

If you are using the #atf: use unicode protocol you must also type the grapheme index numbers as Unicode subscripts using the \-<digit> sequences:

\-00
\-11
...
\-99
\-++
\-xx

N.B.: The new version of cuneitex.el/atf-mode.el has fixed some bugs and updated some characters to the proper positions in Unicode 5.1. You will know that you are using the new version if a menu item 'Update Unicode' appears on the ATF menu. If you have been creating files with unicode using the Emacs Cuneitex input method, you should run this to ensure that your files are correct.