Next: Printing
Up: Essential Topics
Previous: Managing Mail
Contents
To edit your programs, you will need to use an editor. An editor is a little
like a word processor, except that it doesn't know about concepts such as fonts
or styles. It only understands plain text. The better editors have features
which make it easier to write code. The editor we suggest is called GNU Emacs.
Emacs provides a menu-based interface for editing text. The first-time user
will appreciate the menus of common features. If you are familiar with popular
word processing programs, Emacs should seem fairly easy to navigate. It is
important to remember, though, that Emacs is not a word processor. A
word processor has functions for writing, printing, and saving text with
enhancements such as bold text, special paragraph formatting, and pictures.
Emacs is a text editor. It is suitable for editing code and other
plain-text files.
The largest difficulty is learning that Emacs divides everything into
buffers. If you access the help pages from the help menu while
editing a text file, you will need to either kill the buffer with the help
pages, or select the text file buffer (under the Buffers menu) to edit the text
file again. The best way to learn Emacs is to experiment, read the help, and
use the tutorial.
- Special functions are accessed with either the control key or
meta key. Control functions are indicated in the form of
C-x, which means hold down the control key while pressing
x. Meta functions are indicated in the form of M-x,
which means hold down the meta key (the 'alt' key on most PC keyboards) while
pressing x. If there is no meta key on your keyboard, it can be
simulated by pressing and releasing the ESC key, and pressing the
other key. M-x command means press M-x and then enter
the command followed by return. If you cannot remember the entire
command name, pressing TAB will complete the name, and `?' provides a list of
possibilities.
- If you make a mistake entering a command, C-g will cancel it.
This only works while entering it, not afterwords.
- If you make an editing mistake, you can select Undo from the
Edit menu or type the equivalent C-x u.
- If you invoke Emacs from the shell on an terminal emulator, the shell
will be in use until you quit Emacs, unless you tell it to run Emacs in the
background. This is done by appending an ampersand on the command line, i.e.
emacs &.
- If you start Emacs in a text-only environment (From a remote shell, for
example) and wish to exit, use the sequence C-x C-c.
- Emacs allows you to create multiple `windows' within its alloted window
to view any of its buffers. C-x 2 creates two windows, likewise,
C-x 1 returns you to one window.
- Emacs also allows you to use multiple frames running the same program. To
open a file in another frame, choose Open File in Other Frame from the
File menu, or type C-x 5 C-f.
Next: Printing
Up: Essential Topics
Previous: Managing Mail
Contents
Michelle Craft
2008-01-23