Chapter 17. Online Help

Emacs has the most comprehensive online help facility of any text editor—and one of the best such facilities of any program at all. In fact, Emacs’ online help facilities probably cut down the time it took for us to write this book by an order of magnitude. There are three basic aspects of Emacs’ online help:

  • Completion, in which Emacs helps you finish typing names of things (such as filenames).

  • The help key (normally C-h), which allows you to get help on a wide variety of topics and gives you access to such tools as the info database and the Emacs tutorial.

  • Help facilities of complex commands like query-replace and dired.

This chapter deals with all of these in turn.

Completion

We saw an example of Emacs’ completion facility in Chapter 1. Completion is more than just a feature: it is a general principle in the design of Emacs. It can be articulated as follows:

If you have to type in the name of something, and that name is one of a finite number of possibilities, Emacs should figure out what you mean after the smallest possible number of keystrokes.

In other words, you can type in the shortest unambiguous prefix and tell Emacs to figure out the rest of the name. By “shortest unambiguous prefix,” we mean “enough of the name, starting from the beginning, to distinguish it from the other possibilities.” Several important things in Emacs have names that are chosen from a finite number of possibilities, including the following:

  • Commands

  • Files in a given directory

  • Buffers ...

Get Learning GNU Emacs, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.