O'Reilly logo

Learning GNU Emacs, Second Edition by Eric S. Raymond, Bill Rosenblatt, Debra Cameron

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Emacs Commands

You’re about to start learning some Emacs commands, so let’s discuss them a bit first. How do you give commands? Each command has a formal name, which (if you’re fastidious) is the name of a LISP routine inside of Emacs. These names are very long; you usually wouldn’t want to type the whole thing. So we need some way to abbreviate commands.

Emacs ties a command name to a short sequence of keystrokes starting with CTRL or ESC. This tying of commands to keystrokes is known as binding. In the case of the X Window System, Emacs binds some commands to mouse clicks (alone or modified by SHIFT or CTRL) and to options on menus.

The authors of Emacs tried to bind the most frequently used commands to the key sequences that are the easiest to reach. Here are the varieties of key sequences you’ll encounter:

  • The most commonly used commands (such as cursor movement commands) are bound to C- n (where n is any character). To press C- n, press and hold the CTRL key and type n, then release both keys.

  • Slightly less commonly used commands are bound to ESC n, where n is any character. To press ESC n, press the ESC key, release it, then type n. [7]

  • Other commonly used commands are bound to C-x something (C-x followed by something else—one or more characters or another control sequence). Among other types of commands, file manipulation commands, like the ones you are about to learn, are generally bound to C-x something.

  • Some specialized commands are bound to C-c something. These ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required