Emacs editing environment, Part 7: Let Emacs help you out

Get editing assistance right from the editor

Part 7 of this series shows you why Emacs is the self-documenting editor, and the many ways in which you can take advantage of the help and assistance offered in this editor. In this tutorial, learn about describing keystrokes, commands, and functions. You'll also read, browse, and search through a complete Emacs reference manual.

Share:

Before you start

Learn what to expect from this tutorial, and how to get the most out of it.

About this series

The Emacs editing environment is a favorite of UNIX® developers. It's known around the world as the king of editors, but many users find it has a bit of a learning curve. The Emacs environment doesn't seem intuitive at first glance, and it doesn't work like other editors and word processors. But learning Emacs doesn't have to be difficult. Once you get going, you'll see how intuitive it is and become more comfortable with it after each use. This tutorial series (see Resources) shows you the way, taking you from the basics of Emacs, such as its features, philosophy, key-command layout, and methods for editing text, through many of its powerful editing features.

After completing this series (see Resources), you'll be able to comfortably use Emacs for everyday editing, be well on your way to Emacs proficiency, and have a good feel for many of the advanced capabilities of Emacs.

About this tutorial

This is the seventh in a series of tutorials on learning Emacs (see Resources). Previous tutorials in this series took you through the basics; this intermediate-level, hands-on tutorial builds on what you learned in the early tutorials, and shows those already familiar with the rudimentary controls of Emacs how to obtain assistance from Emacs using the many built-in help features.

Emacs is called the self-documenting editor, because assistance is available from the application for every keystroke or action you make. From describing keystrokes, commands, and functions you give it to reading and browsing the many documentation files and a complete reference manual, you learn all the best ways to get instant help from the Emacs editor.

Objectives

This tutorial shows you how to obtain help from Emacs in various ways. After working through this tutorial, you'll know how to get descriptions of keystrokes, commands, functions, and read and browse through the many documentation resources that come with this world-famous open source editor.

Prerequisites

Before working through this tutorial, you should complete the previous tutorials in this series. They lay down the basic foundation, and explain many of the Emacs concepts you use in this tutorial (see Resources).

The special Emacs notation for representing keystrokes, which is used in this tutorial and throughout the series, is described in the introduction of the first tutorial of the series, "Learning the Emacs editing environment, Part 1: The basics of Emacs" (see Resources).

Although this tutorial is written for all levels of UNIX expertise, it's helpful if you have at least a rudimentary understanding of the UNIX file system:

  • Files

  • Directories

  • Permissions

  • File system hierarchy

System requirements

This tutorial requires a user account on any UNIX-based system that has a recent copy of Emacs installed.

There are several varieties of Emacs; the original and most popular is GNU Emacs, which is published online by the GNU Project (see Resources).

You should have a recent copy of GNU Emacs—one that is at version 20 or greater. Versions 20 and 21 are the most commonly available, and development snapshots of version 22 are also available. This tutorial works with any of these versions for Emacs. If your system is running something older, it's time to upgrade.

To know what version of Emacs you have running, use the GNU-style --version flag:

$ emacs --version
GNU Emacs 22.0.91.1
Copyright (C) 2006 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$

You should also have the GNU Emacs documentation installed on your system. Although it's often bundled with the editor, sometimes the Info manual is available separately. Check with your system administrator to make sure you have it installed.


Get help with your keystrokes

Emacs is called the self-documenting editor, because the Emacs help key is available to give you documentation about every command and keystroke—whenever you're entering an Emacs command, you can use the help key to get assistance. The Emacs help key is defined as C-h. All Emacs help facilities begin with this prefix.

This section describes the help commands you can use to get help with particular keystrokes.

Learn what a given keystroke is for

Every keystroke you can type in Emacs is documented, and there are a few ways Emacs can tell you what a particular keystroke is for.

The first and quickest way is through the describe-key-briefly function, which lets you input a keystroke and then tells you, in the minibuffer, the name of the function that keystroke executes. It's bound to C-h c.

Start Emacs now, and try getting help with some keystrokes:

C-h c C-x C-c
C-h c C-h l
C-h c C-h c

You can also get more detailed information about a particular keystroke. The describe-key function, C-h k, gives more information about a key or keystroke, opening a new help buffer in a help window that describes its use. Try running it with a letter key:

C-h k k

As you see from the new window that appears, the K key is bound to the self-insert-command function, which inserts the given keyboard character (in this case, k) at point in the current buffer.

Try finding out what the C-x k command does:

C-h k C-x k

List all the key bindings that begin with a given prefix

The general help prefix, C-h, takes on a special meaning when you use it as a postfix—when you type C-h after some other control-character prefix, you get a new buffer that lists all the available key bindings for that prefix.

For example, the C-x keystroke is a frequently used prefix in Emacs. You learned in the first tutorial in this series (see Resources) that the C-x C-c combination is the usual command to exit Emacs: As the save-buffers-kill-emacs function, it writes all unsaved buffers to disk and then exits the program. You also learned that C-x C-f runs find-file, which opens a file on the file system into a new buffer of its own. But what else has a C-x prefix?

Find out: Type C-x C-h to get a list of possibilities.

When you type this, a new *Help* buffer opens, giving a list of all possible keystrokes that begin with the C-x keystroke.

In a previous tutorial in this series, you learned how to switch between windows and how to resize them—type C-x o C-x 1 to move to the *Help* buffer window, and then resize it to fill the Emacs frame, so your Emacs session looks like Figure 1.

Figure 1. Getting a list of all possible C-x keystroke combinations
Getting a list of all possible C-x keystroke combinations.

When you're done perusing the *Help* buffer, type C-k Enter to kill it.

Learn which commands you can complete

The Emacs help key is more than just a prefix: You can use it even if you're in the middle of typing a command. Whenever you'd like to know which commands are possible for what you've already typed, type C-h.

When you do this, Emacs opens a new *Help* buffer. This buffer shows what commands begin with and what you've already typed.

Try getting a list of possible commands for the C-x a keystrokes. Type C-x a C-h, and notice the new *Help* buffer that appears:

Global Bindings Starting With C-x a:
key             binding
---             -------

C-x a C-a	add-mode-abbrev
C-x a '		expand-abbrev
C-x a +		add-mode-abbrev
C-x a -		inverse-add-global-abbrev
C-x a e		expand-abbrev
C-x a g		add-global-abbrev
C-x a i		Prefix Command
C-x a l		add-mode-abbrev
C-x a n		expand-jump-to-next-slot
C-x a p		expand-jump-to-previous-slot

C-x a i g	inverse-add-global-abbrev
C-x a i l	inverse-add-mode-abbrev

Learn what functions you can type

The Emacs minibuffer offers command completion, which works like its equivalent in the Bash shell and many other UNIX shells.

When you're typing a function and you forget its entire name, you can use completion to get a hint. Press the Tab key whenever you're giving the name of a function, command, or file, and Emacs completes it to the most unique value possible.

For instance, remember from the last tutorial in this series that Emacs can show you the latest phases of the moon. But if you try typing M-x phases-of-the-moon right now, it doesn't work: Emacs reports no match when you tell it to execute that function. Hmm. You know that this function began with phases. What was the command?

To find out, try running it with completion:

Type M-x pha Tab.

When you do this, Emacs completes the command for you. The correct function appears in the minibuffer:

M-x phases-of-moon

Are any other functions available that begin with this name? Press Tab again to see, and look at what the minibuffer says:

M-x phases-of-moon [Sole completion]

If there were more options beginning with the text phases-of-moon, Emacs would have shown you them.

Press Enter to run the sole completion.

Now, try listing all the functions available: Type M-x Tab. You can press Tab repeatedly to scroll down in the list, and then type C-g to destroy the completion-list buffer and cancel your command when you're done.

When more than one completion is possible and Emacs shows a *Completions* buffer in a new window that lists all the possibilities, you can scroll through the completions to select one in various ways:

  • Click a completion with B2 to select it.

  • Move to the *Completions* buffer (such as by typing C-x o), and then press Enter to select the completion nearest to point.

  • Use the possibilities in the *Completions* buffer as a guide, and type out your selection in the minibuffer.

To demonstrate, try the following:

  1. Type M-< C-Spacebar M-> to select the comment code at the top of the *scratch* buffer as the region.

  2. Type C-x mo Tab to pull up a *Completions* buffer that shows all functions beginning with the letters mo.

  3. Click B2 on morse-region to select that function, which converts the text in the region to Morse code.

  4. Type C-x fi Tab to pull up a *Completions* buffer that shows all functions beginning with the letters fi.

  5. Type C-x o C-x o to run the other-window function twice, moving the cursor first from the minibuffer to the *scratch* buffer and then to the *Completions* buffer.

  6. Type C-n enough times that the cursor is on the fill-region function, and then press Enter to select that function.

Now your Emacs session should look like Figure 2.

Figure 2. Running a command on the region using completion
Running a command on the region using completion

View what you've typed

You can view and record a literal stream of all the keystrokes you type in Emacs, which is useful for debugging. There are a few ways to do that.

Look at the lossage

The last 100 keystrokes you made inside Emacs is called the lossage. To view it, run the view-lossage function. It's bound to the C-h l keystroke.

When you run this command, it opens a new *Help* buffer and displays the current keyboard lossage in that buffer.

Try it: Type C-h l.

If you've been following along with the examples in this tutorial, your Emacs session should now look like Figure 3.

Figure 3. Viewing the lossage in Emacs
Viewing the lossage in Emacs

It's important to note that Emacs stores the actual characters you type, not just the names of the commands you run. To see the difference, exit Emacs and then start Emacs again, and view the lossage right away: Type M-x view-lossage Enter.

When you do this, you should see this lossage in the new *Help* window:

M-x v i e w - l o s s a g e <return>

Exit Emacs, start it again, and view the lossage by using completion a couple of times to complete the command: Type M-x view Tab l TabEnter.

When you do this, you run the same command as before, but the lossage looks different:

M-x v i e w <tab> l <tab> <return>

Make a dribble file

If you want to view more than the last 100 keystrokes you've made, you can first open a dribble file; when you do so, Emacs dribbles a copy of everything you type, a single keystroke at a time, into that file until you exit.

To make a dribble file, run the open-dribble-file function. Try it now:

  1. Make a new dribble file: Type M-x open-dribble-file Enter mydribbles Enter.

  2. Type some text in the *scratch* buffer:

    Nothing is ever really lost
  3. View the lossage: Type M-x view-lossage Enter.

  4. Exit Emacs: Type C-x C-c.

After you've done this, look at the contents of your dribble file. It should contain every character you just typed, including the control characters you used to specify Emacs commands.

Summary of Emacs keystroke-help commands

Table 1 lists the various Emacs commands you can use to get help on keystrokes, giving their function name (if applicable) and describing their purpose.

Table 1. Summary of Emacs keystroke-help commands
KeystrokeFunctionDescription
TabThis command performs command completion if given as part of a command, showing all possible input values for the given command.
command prefix or keystroke C-hThis command describes all the possible commands and functions available for the given command prefix or keystroke.
C-h c keystrokedescribe-key-brieflyThis command reports in the minibuffer the name of function that keystroke is bound to.
C-h k keystrokedescribe-keyThis command opens a new help-buffer window that describes the function that keystroke is bound to.
C-h lview-lossageThis command opens a new buffer and displays the last 100 characters typed.
open-dribble-fileThis command opens a specified file and dribbles a copy of all keyboard input to that file.

Get help with Emacs commands and functions

Just as Emacs gives you help on particular keystrokes, you can also get help on particular commands and functions. This section describes those commands.

Learn which commands are right for a task

The command-apropos command tells you which Emacs commands are appropriate for a given keyword. You give this function by typing the help prefix and the C key.

This is a good command to use when you know what you want to do—such as save a file or work with fonts—but you don't know the name of the command, or even what commands are available for a given concept. Follow the command with a regular word or a regular expression, and it returns a new *Apropos* buffer that lists all of the commands whose name contains that word or regexp.

Try getting a list of commands having to do with help: Type C-h a help and look at the contents of the *Apropos* buffer that appears. When you type C-x o C-x 1 to fill the frame with the buffer, your Emacs session should look something like Figure 4.

Figure 4. Emacs command apropos listing
Emacs command apropos listing

Similarly, the apropos function (not bound to any key) lists not only commands and functions that are apropos to a given regexp, but it also lists Emacs variables, which were described in the previous tutorial in this series.

Try getting a list of functions, commands, and variables having to do with help: Type M-x apropos Enter help Enter.

The new *Apropos* buffer that this function gives you lists all the functions you saw with the previous example plus other variables.

Learn what a function does

When you know the name of a function but aren't sure what it does, the describe-function help command, bound to C-h f, is useful. It prompts for the name of an Emacs function and tells you what it does.

Try getting a description of the view-lossage function: Type C-h f view-lossage.

When you do this, Emacs brings up a new *Help* buffer describing the view-lossage function.

(In the previous tutorial in this series, you learned about a similar help command: The describe-variable function, bound to C-h v, describes the contents of a given variable.)

Learn what keystroke a function is bound to

Two important Emacs help commands relate to finding out what bindings are in place and what keystroke a given function is bound to, if any.

The describe-bindings function, C-h b, opens a *Help* buffer listing all the current bindings. If you want to know the binding for a particular function, use the where-is function, which is bound to C-h w. It describes, in the minibuffer, where (on the keyboard) you can find a given function.

Try asking Emacs to describe where the end-of-line function is: Type C-h w end-of-line.

Summary of Emacs function-help commands

Table 2 lists the Emacs commands you can use to get help on particular functions, giving the keystroke they're bound to (if applicable), the function name, and a description of their purpose.

Table 2. Summary of Emacs function help commands
KeystrokeFunctionDescription
aproposThis command gives a list of apropos commands and variables to a given regexp.
C-h a regexpcommand-aproposThis command gives a list of apropos commands to regexp.
C-h bdescribe-bindingsThis command describes all the valid key bindings for the current major mode in a new help buffer window.
C-h f functiondescribe-functionThis command describes the purpose of function in a new help buffer window.
C-h v variabledescribe-variableThis command describes the purpose of variable in a new help buffer window.
C-h w functionwhere-isThis command describes which keyboard binding (if any) a particular function is bound to.

Browse Info: the built-in documentation system

Emacs comes with a great deal of documentation, including a complete manual for users. The manual is written in Info, which is the GNU Project's text-based hypertext documentation system (it precedes the World Wide Web). Although the GNU Info system also has an eponymous, standalone reader application (and many third-party reader applications), you can also read Info documents inside Emacs.

Info documents have a hierarchical, tree-like structure. The basic unit of an Info document is the node, which is the rough equivalent to an HTML page on a Web site; each node describes a topic or subtopic of that Info document.

Nodes contain the text of the document; nodes can also contain any number of cross references, which are hyperlinks that take you to the nodes they reference. The newer versions of Emacs show cross references by highlighting them in color; but you can tell cross references even if you're in a text terminal, because they always begin with the text *Note: and then give the name of the node they refer to.

Nodes can also end with a menu, which is a list of cross-reference links, usually of all the nodes that exist as subtopics beneath the current node. Menus begin with the text * Menu: and then list the cross references on the lines immediately following.

Every Info document has a Top node, which is the starting point for that document tree—think of it as the table of contents in a printed book. The Top node contains a main menu for that document, showing all the major subdivisions in the document. Documents usually also have an Index node containing a list of all nodes in that document.

The GNU Info system keeps a directory of all Info documents stored on the system in a special, main Top node called the Directory node. When new Info documents are installed on the system (often in the /usr/share/info directory, but this differs across different UNIX implementations), they're added to this node.

With the exception of the Directory node, nodes always have an Up node that brings you to the topic the current node is a subtopic of; the Up node of a document's Top node is the main Directory node. Nodes can also have other nodes designated as their Next and Previous nodes—those are nodes that are at a parallel level to the current node in the document tree.

Figure 5 illustrates the GNU Info system's node structure, showing a simplified view of the Directory node with example Info documents.

Figure 5. Sample GNU Info-document hierarchy
Sample GNU Info-document hierarchy

Start Info

The info function (bound to C-h i) starts Info, opening to the main Directory node containing links to all the Info documents installed on the system.

Start Info by typing C-h i.

This opens a new *info* buffer containing your system's main Info Directory node. This is the highest Top node in the system. There are no nodes above it, nor does it have a Next or Previous node; the only nodes available are the ones in its menu.

Select a node

Use the cursor keys to move down to the menu item for the Emacs node—it begins with the text * Emacs:—and press Enter to select it.

When you do this, Info opens the Top node of the Emacs manual, as in Figure 6. It has an Up node (the Directory node you just came from) and a Next node, which is the first chapterM in the manual. It also has a Previous node, which in this case is also the Directory node.

Figure 6. Viewing the GNU Emacs manual in Info
Viewing the GNU Emacs manual in Info

Move in and between nodes

There are a few ways to move through a node. Use the PgUp and PgDn keys to scroll through a node a screen at a time. When you use these keys, you scroll only through the current node—once you reach the top or bottom of the node, you stop scrolling in that direction.

Try using PgDn to move through the node you're in, showing the main menu of the Emacs manual.

You can also use the Spacebar and Backspace keys to scroll forward and backward through the node and automatically move between nodes: If you encounter a menu while scrolling forward in the node, you immediately move to the first node referenced in that menu; and if you encounter the top of the node while scrolling backward in the node, you immediately move to the top of that node's Previous node.

When you use these two keys to scroll through nodes, you can cycle through an entire Info document. However, you can't move to another document in the Directory node this way. Note in Figure 5 how all menu items form parallel links that you can move between, except for menu items in the Directory node. In this example, suppose you're at the Gizmo manual node: Pressing the Spacebar repeatedly takes you through that node to the following nodes:

  • Using gizmos

  • Turning them on

  • Turning them off

  • Replacing gizmos

Try pressing the Spacebar several times to move to the Next node and then through it and several other nodes.

You can also move to the Next and Previous nodes at any time by pressing N and P, respectively.

To move to the Up node, press U; and to move to the last node you visited before the current node, press L.

To follow a particular item in a menu or a cross reference given somewhere in a node, move the cursor onto it and press Enter. You can also use the mouse by clicking B2 on the link.

Try moving through the Emacs documentation using the commands you've just learned.

Search for a topic

You can use several techniques to search inside Info. One way uses the Info-index command, bound to the I key, which searches the Index node of that document for the given text.

Try searching for info in the Emacs manual:

  1. Press I to run the Info-index command.

  2. At the Index topic: prompt, type info Enter.

When you do this, Emacs displays the page of the manual that discusses using Info.

You can also search incrementally through the current node by using the Emacs isearch-forward function, which is bound to C-s and was described earlier in this series.

Search forward through the current node for info: Type C-s info to move the cursor to the next instance of the text, and then type C-s repeatedly to cycle through all the instances of info in that node.

To search for text through the current node and all other nodes, use the Info-search function, bound to the S key. It moves to the next instance of the given text anywhere in the Info document.

Try searching for info again:

  1. Type M-> to move to the end of the node.

  2. Press S to run the Info-search function.

  3. In the minibuffer, type info Enter.

When you do this, Emacs moves to the next instance of the text info, which occurs in another node in the document.

Leaving Info

There are a few different ways to put Info behind you.

To switch to another buffer and move the Info buffer to the background of the buffer list, press Q.

Try it now, and see how Emacs displays another buffer; then type C-x b *info* Enter to move back to the *info* buffer.

To kill the *info* buffer, type C-x k (just as you would with any buffer). *info* is removed from your buffer list; to view it again, type C-h i to start from the beginning.

Summary of Emacs Info commands

Table 3 lists the various keystroke commands that are available in Info mode and describes their function.

Table 3. Summary of Emacs Info mode commands
KeystrokeFunctionDescription
HInfo-helpThis command opens a hands-on Info tutorial in a new buffer.
QInfo-exitThis command moves to the last buffer you visited, putting the *info* buffer in the end of the buffer list.
Enter
or
B2
This command follows the cross reference at or near point.
NInfo-nextThis command moves to the current node's Next node.
PInfo-prevThis command moves to the current node's Previous node.
UInfo-upThis command moves to the current node's Up node.
DInfo-directoryThis command moves to the Directory node.
LInfo-lastThis command moves to the last node you visited.
TInfo-top-nodeThis command moves to the Top node of the current document.
>Info-final-nodeThis command moves to the final node pointed to in the current document.
SpacebarInfo-scroll-upThis command moves forward in the current node by a single screen; if at the end of the node, then move to the Next node.
BackspaceInfo-scroll-downThis command moves backward in the current node by a single screen; if at the beginning of the node, then move to the Previous node.
Bbeginning-of-bufferThis command goes to the beginning of the current node.
SInfo-searchThis command searches forward in the current Info document for a given regexp.
TabInfo-next-referenceThis command moves the cursor forward to the first cross reference.
M-TabInfo-prev-referenceThis command moves the cursor backward to the last cross reference.

Read the documentation files

In addition to the GNU Emacs manual and other GNU manuals that you can read in Info, the GNU Emacs editor comes with a few special built-in document files, and they are available for reading inside Emacs at a keystroke.

Read about what's new

A revision log of the latest versions of Emacs is readable inside Emacs by running the view-emacs-news function, which is bound to C-h n.

Try running it now to see the latest changes in the version of Emacs you have installed on your system: Type C-h n.

When you type this, Emacs opens a new buffer named NEWS. Notice the two percentage signs in the mode line, showing that the buffer is marked read-only.

Learn the licensing

The GNU General Public License (GNU GPL), that famous copyleft software license that kicked off the new methodology of networked collaboration that brought about open source software, is available for reading when you run the describe-copying function, which is bound to C-h C-c.

You can also learn about the Emacs warranty (there is none), which is described at the bottom of the license. Go straight to these details with the describe-no-warranty function, which is bound to C-h C-w.

Learn about the GNU Project

The describe-project function, bound to C-h C-p, is a 7,500-word essay by Richard Stallman, Emacs' principal author, describing the purpose of the GNU Project (which he founded).

The GNU Manifesto is a famous document that was distributed on the Internet in the early years of the GNU Project; it's one of the first nodes in the GNU Emacs manual, which you can read by opening the Emacs manual in an *info* buffer, as described in Select a node section:

  1. Type C-h i to open an *info* buffer.

  2. Use C-n to move down to the Emacs manual, and select it by pressing Enter on the * Emacs: menu item.

  3. Use C-n to move down to the * Manifesto: menu item, and press Enter to select it.

The describe-distribution function, bound to C-h C-d, tells you how you can obtain a recent copy of Emacs directly from the GNU Project.

Bring up the FAQ

The GNU Emacs FAQ is an Info document containing many frequently asked questions pertaining to the installation and use of Emacs. You can read a copy in Emacs by running the view-emacs-faq function, which is bound to C-h F.

A useful section of this document is the Common requests node, which contains a long listing of common improvements and customizations that people generally want to do with Emacs.

Try viewing that node: Type i req Enter, and your Emacs session should look like Figure 7.

Figure 7. Viewing the "Common requests" node of the GNU Emacs FAQ in Info.
Viewing the Common requests node of the GNU Emacs FAQ in Info.

Read about obscure problems

The GNU Project keeps a list of obscure implementation problems that people sometimes encounter while running Emacs and the solutions those users have found to overcome them. This list is available by running the view-emacs-problems function, which is bound to C-h P.

Summary of Emacs help files

Table 4 lists some of the documentation files that come with Emacs and gives the functions and keystrokes used to view them, as well as their descriptions. These files are normally kept in the etc subdirectory of the main Emacs directory tree, which on many UNIX systems is found at /usr/share/emacs/VERSION/etc/, where VERSION is the version number of the copy of Emacs that is installed. This directory contains many more documentation-related files of varying utility.

Table 4. Summary of Emacs documentation files
KeystrokeFunctionFilenameDescription
C-h C-ddescribe-distributionDISTRIBInformation on obtaining a copy of the latest distribution of the Emacs software
C-h Fview-emacs-faq/usr/share/info/emacs-mainversion/efaq.gzEmacs FAQ
C-h C-cdescribe-copyingCOPYINGGNU General Public License (GNU GPL)
C-h C-wdescribe-no-warrantyCOPYINGSection "NO WARRANTY" of the GNU General Public License (GNU GPL)
C-h nview-emacs-newsNEWSNews concerning the latest changes in the current version of Emacs
C-h Pview-emacs-problemsPROBLEMSEmacs problems file
C-h C-pdescribe-projectTHE-GNU-PROJECTEssay by Richard Stallman concerning the founding of the GNU Project
C-h thelp-with-tutorialTUTORIALHands-on tutorial for learning the basics of Emacs

Summary

Get help on help

As in the List all the key bindings that begin with a given prefix section, you can use the C-h Emacs help key as a postfix to get help on C-h itself.

Try it: Type C-h C-h.

Doing so runs the Emacs help-for-help function, which opens a new *Help* buffer containing all the Emacs help commands. As in an Info node, you can press Spacebar and Backspace to scroll forward and backward through the buffer, or you can use the initial of a help command to run that command. Press Q to exit this Help menu.

Summary of Emacs help commands

Table 5 lists all the Emacs help commands and describes their functions.

Table 5. Summary of Emacs help commands
KeystrokeFunctionDescription
aproposThis command gives a list of apropos commands and variables to a given regexp.
open-dribble-fileThis command opens a specified file and dribbles a copy of all keyboard input to that file.
TabThis command performs command completion if given as part of a command, showing all possible input values for the given command.
command prefix or keystroke C-hThis command describes all possible commands and functions available for the given command prefix or keystroke.
C-h C-cdescribe-copyingThis command views the GNU General Public License (GNU GPL).
C-h C-ddescribe-distributionThis command views information on obtaining a copy of the latest distribution of the Emacs software.
C-h C-pdescribe-projectThis command views an essay by Richard Stallman concerning the founding of the GNU Project.
C-h C-wdescribe-no-warrantyThis command views the "NO WARRANTY" section of the GNU GPL.
C-h a regexpcommand-aproposThis command gives a list of apropos commands to regexp.
C-h bdescribe-bindingsThis command describes all valid key bindings for the current major mode in a new help buffer window.
C-h c keystrokedescribe-key-brieflyThis command reports in the minibuffer the name of function that keystroke is bound to.
C-h Fview-emacs-faqThis command views the Emacs FAQ Info document.
C-h f functiondescribe-functionThis command describes the purpose of function in a new help buffer window.
C-h k keystrokedescribe-keyThis command opens a new help buffer window that describes the function that keystroke is bound to.
C-h lview-lossageThis command opens a new buffer, and displays the last 100 characters typed.
C-h nview-emacs-newsThis command views news concerning the latest changes in the current version of Emacs.
C-h Pview-emacs-problemsThis command views the Emacs problems file.
C-h thelp-with-tutorialThis command opens a hands-on tutorial for learning the basics of Emacs.
C-h v variabledescribe-variableThis command describes the purpose of variable in a new help buffer window.
C-h w functionwhere-isThis command describes which keyboard binding (if any) a particular function is bound to.

Wrap-up

Emacs is a large and complex application and, as you've just seen, it has a built-in help system to match. You've learned how to use it, getting Emacs to help you at every level: identifying keystrokes, commands, and functions; giving you lists of meaningful, possible, and appropriate commands; presenting the Emacs manual that you can browse with the built-in documentation system; and showing you the other informative files that come with Emacs.

After this, you know enough about getting automatic assistance whenever you're stuck, so the next time it happens, you can ask Emacs to help you out.

Resources

Learn

Get products and technologies

  • GNU Project Web site: Download a free copy of the latest GNU Emacs for your OS and architecture free of charge.
  • IBM trial software: Build your next development project with software for download directly from developerWorks.

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into AIX and Unix on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Linux, Open source
ArticleID=269262
ArticleTitle=Emacs editing environment, Part 7: Let Emacs help you out
publish-date=11132007