Next: Files (Opening, Saving, Printing,
Up: The Basics
Previous: Some Vocabulary
Contents
Emacs Commands
The
``mac'' in ``emacs'' came from the word ``macros.'' Every single command
available to you, and commands you write yourself (see Section
8.1: Macros below) is a function written in a
programming language called emacs-lisp. They all have names like
canonically-space-region or indent-region or ispell-buffer. Many of
those commands are associated with keyboard shortcuts like C-n (to
move the cursor down one line) but they also have a long name as well
(in this case C-n is the command next-line). Not all of the commands
available to you have a keyboard shortcut; those that don't are
accessed by hitting M-x and their long name. For example, type M-x
ispell-buffer to begin spell checking the entire document. Once you
hit M-x you can type just isp and hit tab, and emacs will try to
complete the command with the options available to it. In this case
it will get as far as ispell- because there are several commands whose
names start with that sequence of letters. Continue by typing bu
and hitting tab. Emacs will now complete the command: ispell-buffer.
Hit return and the spell checking will begin.
In the rest of this document, remember that commands that don't have a
shortcut like C-t (transpose characters) can be accessed by typing M-x
plus the long name of the command, so M-x transpose-characters and
hitting return.
You'll notice as you get more familiar with emacs that commands come
in basically three flavors: those that begin with C-x, those that
begin with C-c, and those that begin with M-x. C-x is reserved for
the most common commands and particularly those that involve reading
in and saving buffers, so C-x C-f to ``find'' a file,
C-x C-c to quit, and so on. Commands that are less
frequently used get relegated to C-c, which you'll notice is
a little more of a stretch for your finger to reach. M-x, as
explained above, is used to access commands by their long names.
While there are a couple of other key combinations, like C-h
for commands related to the help system, these are few in number.
Next: Files (Opening, Saving, Printing,
Up: The Basics
Previous: Some Vocabulary
Contents
Randall Wood
2011-03-31