Emacs: Finding Functions and Documentation Lookup

Buy Xah Emacs Tutorial. Master emacs benefits for life.
, , …,

This page shows you how to find the emacs lisp function you want, and methods to lookup function's documentation.

For how to eval lisp expressions, see: How to Evaluate Emacs Lisp Code.

Inline Documentation Lookup

Call describe-functionF1 f】, then type the function name. If the word the cursor is on is a valid elisp function name, emacs will use that by default.

Call describe-variableF1 v】 for inline doc of variables.

emacs describe-function
emacs describe-function output

If you are using emacs 23 or later, you can use the asterisk “*” as a wildcard when looking up function or variable doc. For example, type 【F1 f *file Tab ↹】 and emacs will list all functions whose name ends in “file”.

Once the function's inline doc string page comes up, you can jump to the function's location in source code by clicking on underlined file name (or press Tab ↹ to move your cursor to the link then press Enter ↵).

Searching for Functions

To search command names, call apropos-commandF1 a】.

To search both function and command names, call apropos-command with a empty argument, like this: 【Ctrl+u F1 a】.

(Tech detail: In emacs, “commands” are a subset of “functions”. Commands are functions that can be called interactively (by typing 【Meta+x】). A function is a command when its definition contains the (interactive …) clause.)

To search variable names, call apropos-variable.

To search variable values, call apropos-value.

To search all symbols space (commands, functions, variables), call apropos.

Finding a Function's Documentation in Elisp Manual

Use elisp-index-search to find a function's documentation in the emacs lisp manual.

Use emacs-index-search to find a function's documentation in the emacs manual.

Tip: if you use these commands often, you can give them a key. See: Emacs: How to Define Keys.

Like it?
Buy Xah Emacs Tutorial
or share
blog comments powered by Disqus