Spring 2006
Williams College
Basic Emacs
The last line of the emacs window is where command prompts and messages appear. The reverse video line immediately preceding it is a status line. It shows you the name of the file you are editing. Before that you should see -----. This means that the file is up-to-date. If it says, ---**, it means the buffer has been changed since it was last saved. If it says ---%%, it means that you cannot modify the file. After the filename is the "mode" that you are editing in. This should say "(Fundamental)", or "(Java)" when editing a Java file. Next is the current line number (L1 indicates the first line). Following that is an indication of how far the current line is in the file in terms of percentage. "All" indicates that the entire file is showing. "Top" indicates that you are on the first screenful. "Bottom" indicates that you are on the last screenful.
The area between the menu titles and the status line is the buffer that displays the contents of the file. Most of your typing goes directly into this buffer. Type some text. Notice the status line changes. You can move the cursor around using the arrow keys. Use the "C-x C-s" command to save the buffer to a file. Use "C-x C-c" to exit emacs. Here are the keyboard sequences for the most common Emacs commands:
C-v Next screenful M-v Previous screenful C-d Delete next character Backspace Delete previous character C-x C-s Save buffer to a file C-x C-f Open a file C-x C-c Exit Emacs C-g Clear/cancel any command you are in
(accidentally or on purpose!)
You can find more Emacs commands in the Emacs Hints Page.