Copyrighted 1992 by Urban A. LeJeune The EMACS Editor The Unix EMACS editor, which is available on Pilot, is difficult to use when one has used DOS type editors or word processors. However, there are times when creating, or modifying, a file on your PC and then transferring it to Pilot is just to labor intensive. If you only have a short amount of editing, such as modifying your .mminit file, it might be easier to use EMACS. This lesson will introduce only enough commands to let you kludge your way through an EMACS session. The full keystroke documentation for the editor is available as file emacs.chart in directory /usr/doc. At the pilot % prompt enter "cd /usr/doc". At the pilot % prompt enter "more emacs.chart" to display the file or you may enter Kermit and transfer it to your PC. After finishing with the documentation directory enter "cd" with no argument and you will be returned to your home directory. EMACS Conventions EMACS commands typically involve the use of a control key, frequently labeled CTRL or Ctrl on your PC keyboard. The following shorthand notations will be used for this discussion. ^ will indicate that you press the Ctrl key and while holding it down press the key. ^x means to press the Ctrl key and then press the x key while holding down the Ctrl key. EMACS also uses a meta key which is not defined on a PC. m means hold down the meta key and while holding it down press the key. Since there is no meta key on the PC an instruction such as m-d would require that you press the Esc key, release it, press the m key and release it, press the Esc key again, release it and finally press the d key. I said it would be a Kludge! One last note. The sequence ^x^s is supposed to save a file. Every time I have tried it my session has hung. Entering ^x^c exits EMACS but it will first prompt you asking if you want to save the modified file. This gets around the problem. ^z aborts the entire session. To start a session enter emacs at the % prompt. EMACS Commands ^x^c emit emacs ^x^f find (load) a file ^b move backward a character ^f move forward a character m-b move backward a word m-f move forward a word ^n move to next line ^move to previous line ^a move to beginning of line ^e move end of line ^d kill (delete) character at cursor ^k kill (delete) from cursor position to end of line. To delete entire line cursor must be at start of line and enter the ^k command twice. ^y restore last deleted line ^v go to next screen m-v go to previous screen ^i repaint screen ^s forward search. Slowly, one letter at a time, type the target word. ^r reverse search m-d move back to beginning of sentence m-e move forward to beginning of sentence m-k kill (delete) to the end of current sentence m-< go to beginning of file m-> go to beginning of file