Выбрать главу

Hold down the Meta key and press -.

To complete a command you may need to press Enter. (This key may be labeled Return.)

Enter

Press the Enter key.

Esc

Can be used as an alternative to Meta. Press Esc, release it, then press the next key.

A few mouse commands use the Shift key as a modifier, often in combination with the Ctrl key. This is abbreviated as:

S-right

Hold down Shift and click the right mouse button.

C-S-right

Hold down Shift and Ctrl and click the right mouse button.

All Emacs commands, even the simplest ones, have a full name; for example, forward-word is equivalent to the keystrokes M-f, and forward-char is equivalent to C-f. This tying of a command to a keystroke combination is called a key binding. Some commands have only full names, with no corresponding key binding.

When we discuss a command, we'll give both its full name and the keystrokes (if any) that you can type to invoke it.

Command Tables

To find a group of commands quickly, look for tables in each section that summarize commands. These tables are formatted like this:

Keystrokes Command name Action
C-n next-line Move to the next line.
C-x C-f FileOpen File find-file Open a specified file.
(none) yow Print ineffable wisdom from the Pinhead in the minibuffer.

The first column shows the default key binding for the command, the second column shows the command's full name, and the third column describes what the command does. For example, pressing C-n (also known as the next-line command) moves the cursor to the next line in the file. Some commands, like C-x C-f, can also be reached through menus. If there is a menu option for a particular command, it is given in italics below the keystrokes for the command. For example, you can use the find-file command by typing C-x C-f or by selecting Open File from the File menu. Sometimes you'll see (none) in the keystrokes column, which doesn't mean you can't use the command, but rather that the command isn't bound to particular keystrokes. To use commands with no keystrokes, type M-x, followed by the command's full name, and press Enter. (Try typing M-x pong Enter sometime.)

Examples

Throughout the book, you'll find keystrokes to type, followed by a screenshot showing the results.

Type: C-x C-f myfile

Use the find-file command to open a file or create a new file.

C-x C-f is in bold, indicating that this is exactly what you type. myfile is shown in constant width italics because you could substitute any filename you choose and need not type exactly what you see here.

Typically, these screenshots come from a Linux system. We also include screenshots taken on Mac OS X and Windows. When we show such screenshots, we include an indication of the platform in the caption for the screenshot.

Toward the end of the book, when we're discussing programming modes, customization, and Lisp programming, screenshots become rather unwieldy. We eventually use fewer of them. Instead, we may show one or two lines of text. If it's relevant, we show the cursor's position:

/* This is a c comment */

Font Usage

This book uses the following font conventions:

boldface

Indicates operating system commands, Emacs keystrokes, command names, and variables.

italic

Indicates filenames, URLs, and new terms when first introduced.

constant width

Indicates buffer names, Lisp code, C code, Emacs messages, and other excerpts from programs.

constant width italic

Indicates dummy parameters that you replace with an actual value. May also be shown sometimes in angle brackets (<filename>).

How to Contact Us

We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made mistakes!). Please let us know about any errors you find, as well as your suggestions for future editions, by writing to: O'Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 1-800-998-9938 (in the U.S. or Canada) 1-707-829-0515 (international/local) 1-707-829-0104 (FAX)

To ask technical questions or comment on the book, send email to:

bookquestions@oreilly.com

We have a web site for the book, where we'll list examples, errata, and any plans for future editions. You can access this page at:

http://www.oreilly.com/catalog/gnu3/

When you see a Safari® enabled icon on the cover of your favorite technology book that means the book is available online through the O'Reilly Network Safari Bookshelf.

Safari offers a solution that's better than e-Books. It's a virtual library that let's you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you nee the most accurate, current information. Try it free at http://safari.oreilly.com.

For more information about this book and others, see the O'Reilly web site:

http://www.oreilly.com

You can also send questions about Emacs and suggestions about this book to deb@oreilly.com.

Acknowledgments

Debra Cameron: First, I would like to thank Duffy Craven for introducing me to Emacs. Second, I would like to thank my coauthors. Bill Rosenblatt was a tremendous help on the first edition of this book, and Eric Raymond worked with blinding speed and brilliance on the second, providing some input on the third as well. I would especially like to thank my coauthors Jim Elliott and Marc Loy, without whom, in all honesty, this third edition would never have been finished. Their constant encouragement, support, and hard work helped make this edition a reality. I would like to thank all the readers who wrote in with their suggestions, especially Russell Harris, Seema Kumar, and Hui Oulan. I would also like to thank Eric Pement, who pointed me to the very interesting TEI Emacs add-on, as well as the authors of that extended environment for Emacs, including Sebastian Rahtz and Syd Bauman. Personally, I would like to thank my husband Jim and my kids Meg, David, Beth, and Kevin for their patience and help during the revision of this book and also my friends Irene and Jacki for their support. Most of all, I would like to thank all the developers and hackers who continue to make GNU Emacs the most amazing piece of software I have ever worked with.