Sams Teach Yourself Emacs in 24 Hours |  | ContentsIndex
Hour 1: Introduction to Emacs |  | Previous HourNext Hour
Sections in this Hour: |  |

## The Keyboard Quick Reference Card

Emacs has thousands of different functions for doing almost anything that is possible with a computer. Many of these are available from the keyboard. The most important functions are easily available (for example, search forward is bound to C-s), but others are bound to hard-to-remember keys (for example, C-x r b for Jump to Bookmark). Functions that the developers of Emacs have found are even less likely to be used, or that come with extra packages, are not bound to keys. Examples of this include Search in multiple files using tags and Spell-check buffer.

The functions that are either not bound to a key or that are bound to keys that are difficult to remember can be bound to the function keys that are available on any new keyboards.

The CD contains a keyboard quick reference card that can be printed out and attached to the keyboard. You need to modify this quick reference card to include the functions that you find most interesting and useful. In Figure 1.9 you can see a sample quick reference card.

Figure 1.9
The keyboard quick reference card that is available on the CD.

It is, of course, not enough for Emacs that you attach a piece of paper to the keyboard; you must also tell it about the keybinding. You can do this by inserting a line similar to the following into your .emacs file:

    (global-set-key [(control f6)] 'sams-toggle-truncate)

This line tells Emacs that pressing Ctrl, holding it down, and pressing the key labeled F6 causes Emacs to invoke the function sams-toggle-truncate. Please note the single quote before the word sams.

Throughout this book, function names are given whenever a function is discussed. This way, you can easily bind any of the function keys without a modifier, or with Ctrl, Shift, or Meta as the modifier.

The following information is available on the CD.

This is a sample Lisp file with the bindings from my setup; here you can see examples of binding any of the twelve function keys:

    /usr/share/emacs-lisp/refcard/refcard.el

The following is the keyboard quick reference card for UNIX users. It is made in LaTeX. At the top of the file there is a description of how to print it out. If you have LaTeX installed on your system, you can probably make your own quick reference card without knowing anything about LaTeX:

    /usr/share/emacs-lisp/refcard/refcard.tex

The following is a sample of my personal setup. Some of the functions that are described on my quick reference card are not even mentioned in this book, nor are they available on the CD, so this is to only be used as an example of how to use the keyboard quick reference card:

    /usr/share/emacs-lisp/refcard/refcard-example.tex

This is the keyboard quick reference card for Windows users. It is in RTF, which means that MS Word, WordPerfect, and a number of other Windows programs can read it:

    /usr/share/emacs-lisp/refcard/refcard.rtf

The following is my setup in RTF. Once again, please note that this is only an example:

    /usr/share/emacs-lisp/refcard/refcard-example.rtf

This is an empty quick reference card, to be used for an emergency--in case, for example, you do not have the appropriate tools to edit the other quick reference cards. Simply print these out and write on them with a pen or pencil:

    refcard.ps and refcard.pdf

Sams Teach Yourself Emacs in 24 Hours |  | ContentsIndex
Hour 1: Introduction to Emacs |  | Previous HourNext Hour
Sections in this Hour: |  |

© Copyright Macmillan USA. All rights reserved.