Basics of Emacs manual documentation

(Date: 17 November 2024)

Summary

I introduce the basics of Emacs manual documentation, how to open the manuals, reference the manuals, and print the manuals.

Introduction

A key principle of Emacs is the self-documentation and discoverability.

(“Emacs is the advanced, extensible, customizable, self-documenting editor.”)

The help prefix is C-h or F1. The Emacs manual can be accessed from within Emacs with C-h r. The “online manuals” info facility is accessible with C-h i, M-x info.

A very useful entry point is the following type of ‘context’ help. You can lookup a symbol at point with C-h S, M-x info-lookup-symbol. This depends on the major mode to use the appropriate manual. Once in the manual you can use i to search the index.

The docstrings in Emacs Lisp are certainly of high quality; indeed one Emacs core contributor explained on emacs-devel that he learnt Emacs Lisp this way before realising there was a manual. But the manuals are also well-written and convenient to navigate.

Referring to the manuals online

The GNU Emacs manuals and related are hosted at GNU Emacs manuals

Other GNU manuals, such as GNU Manuals

If you are browsing documentation within Emacs, there are built-in functions to extract references. You can then use this in online locations (websites, blogs, forums, social media) to point readers back to more documentation.

Emacs manual example

For example if you want to read about the Dired directory editor, and reference it.

Press C-h r, then navigate to the dired node with m RET Dired RET, then w, Info-copy-current-node-name, which returns (emacs) Dired.

You can then provide the following expression for readers to navigate locally to it as M-: (info "(emacs) Dired)"

If you want to retrieve the web page for this manual node, simply press G in the Info reader and it will go to the corresponding page. https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html

Emacs lisp manual example

For example M-x find-function RET car followed by w, Info-copy-current-node-name, which returns (elisp) List Elements. You can then provide the following expression for readers to navigate locally to it as M-: (info "(elisp) List Elements)"

You can then evaluate M-: (Info-url-for-node "(elisp) List Elements")

Similarly, the corresponding url is https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Elements.html

Printing the manuals

A key purpose of the Texinfo format is the ability to export to LaTeX to create printed manuals.

Texinfo is the official documentation format of the GNU project. It is used by many non-GNU projects as well.

Texinfo uses a single source file to produce output in a number of formats, both online and printed (HTML, PDF, DVI, Info, DocBook, LaTeX, EPUB 3). This means that instead of writing different documents for online information and another for a printed manual, you need write only one document. The Texinfo system is well-integrated with GNU Emacs.

See Texinfo

You can use the pdf output to print. Depending on the size of the manual, you may wish to send it to a print shop to print it with circular bindings, for example the Emacs manual itself. This type of binding opens flat and can be used as a desk reference.

Conclusion

The Emacs manuals are carefully written by the core developers, and easy to use, reference, and print. You can use the manuals for learning Emacs, and also to reference in your own work.