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 corresponds to M-. On macOS, the Terminal application can be configured to use the OPT (Option) key as M-. If you are using macOS and have not set up OPT to work as meta, then follow the instructions in the macOS Setup Guide.

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 term for 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.

3.2.1. Special Keys and Notation

In addition to modifier keys, Emacs documentation uses specific notation for special keys:

Notation

Key on Keyboard

RET

Return / Enter

SPC

Space bar

DEL

Backspace

TAB

Tab

ESC

Escape

3.2.2. Reading Keystroke Sequences

In the table below, we use KEY(key) to denote that you should press key while holding KEY, and (key) to denote that key should be pressed without holding a modifier key.

Command

Binding

Keystrokes

Open/Find File

C-x C-f

Hold CTRL, press x, press f, release CTRL

Emacs tutorial

C-h t

Hold CTRL, press h, release CTRL, press t

If a binding has consecutive occurrences of the C- modifier key (such as C-x C-f), there is no need to release CTRL between those keystrokes:

  • CTRL(x), CTRL(f) (press x with CTRL, release CTRL, then press f with CTRL)

  • CTRL(x, f) (hold CTRL continuously while pressing x then f)

Note

When using ESC as Meta (M-), press and release ESC before pressing the next key. When using ALT or OPT, hold the key down while pressing the next key, just like CTRL.

Rapid Fire Review
  1. What does C- represent?

    1. The Command key

    2. The CTRL key

    3. The META key

    4. The SHIFT key

    Sample Solution

    b. C- represents the CTRL (Control) 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

    Sample Solution

    c. On Linux and Windows systems, ALT or ESC is used. On macOS, OPT (Option) or ESC is used.

  3. What are the corresponding keystrokes to execute the C-x h key binding? Note: This command marks (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

    Sample Solution

    d. In C-x h, only x has the C- modifier. Hold CTRL, press x, release CTRL, and then press h.