3.2. Control and Meta

Throughout this chapter, we will use C- to refer to the control key (CTRL) and M- to refer to the meta key. On most systems, ALT or ESC correspond to M-. On macOS, the Terminal application can be configured to use OPT (option) key as M-. If you are using macOS and have not setup OPT to work as meta, then follow the instructions here.

Modifier Key

Name

Usually

C-

Control

CTRL

M-

Meta

ESC, ALT, or OPT

Emacs commands are recognized by their key bindings, which is just a fancy way of saying keyboard shortcuts. To use Emacs commands effectively, you need to understand how to read their associated key bindings so that you can successfully make the appropriate keystrokes. In the table below, we’ll use KEY(key) to denote that you should press key while holding KEY and (key) to denote that key should be pressed without any kind of modifier key. For example, CTRL(x, f) means to hold CTRL, press x, then press f, then release CTRL. An alternative would be CTRL(h), (t) which means to hold CTRL, press h, release CTRL, then press t.

Command

Binding

Alternative

Keystrokes

Open/Find File

C-x C-f

C-xf

CTRL(x, f)

Emacs tutorial

C-h t

CTRL(h), (t)

If a binding has consecutive occurrences of either the C- or M- modifier keys, then there is no need to release the modifier key between those occurrences. This can be seen in the first example, where both of the following keystroke sequences result in C-x C-f:

  • CTRL(x), CTRL(f)

  • CTRL(x, f)

Rapid Fire Review
  1. What does C- represent?

    1. The Command key

    2. The CTRL key

    3. The META key

    4. The SHIFT key

  2. Which key typically corresponds to the Meta M- key on most systems?

    1. The SHIFT key

    2. The CTRL key

    3. The ALT, ESC, or OPT key

    4. The Command key

  3. What are the corresponding keystrokes to execute the C-x h key binding? Note: This command highlights all text in the current Emacs buffer.

    1. Hold CTRL, press x, then press h while holding CTRL

    2. Press x, release, then press h while holding CTRL

    3. Hold META, press x, then h

    4. Hold CTRL, press x, release CTRL, then press h