651
GNU Emacs Manual

GNU Emacs Reference Card

  • Upload
    netecol

  • View
    22

  • Download
    6

Embed Size (px)

DESCRIPTION

GNU Emacs User's ManualSeventeeth Edition, Updated for Emacs Version 24.2By Richard Stallman, et al.For all your l33t h4x0r programming needs. No one is reading this, right? Remember MEmacs on the Commodore Amiga? That was one of my first text editors. I replaced it with Text Engine shortly after because it was much easier to create text files. Oh, the good old days.

Citation preview

  • GNU Emacs Manual

  • GNU Emacs Manual

    Seventeenth Edition, Updated for Emacs Version 24.2.

    Richard Stallman et al.

  • This is the Seventeenth edition of the GNU Emacs Manual,updated for Emacs version 24.2.

    Copyright c 1985-1987, 1993-2012 Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3or any later version published by the Free Software Foundation; withthe Invariant Sections being The GNU Manifesto, Distribution andGNU GENERAL PUBLIC LICENSE, with the Front-Cover texts beingA GNUManual, and with the Back-Cover Texts as in (a) below. A copyof the license is included in the section entitled GNU Free DocumentationLicense.

    (a) The FSFs Back-Cover Text is: You have the freedom to copy andmodify this GNU manual. Buying copies from the FSF supports it indeveloping GNU and promoting software freedom.

    Published by the Free Software Foundation51 Franklin Street, Fifth FloorBoston, MA 02110-1301 USAISBN 978-0-9831592-4-7

    Cover art by Etienne Suvasa; cover design by Matt Lee.

  • Did Amazon sell you this book?

    Either way, thank you for buying this title from GNU Press. GNU Press is the pub-lishing outfit of the Free Software Foundation, a nonprofit organization in Boston,Massachusetts.

    While we appreciate your purchase, we hope that in the future you will buy directlyfrom us at http://shop.fsf.org. We list our books on Amazon so more peoplecan find them, but selling books on Amazon is something we would rather not do,because:

    Amazon is bad for small publishers. Amazon requires that we sell them ourbooks at a 55% discountand pay for their shipping. The standard bookstorepays for its own shipping and only asks for a 40% discount. Amazon cutsbetter deals with larger publishers, and finances those deals by forcing steepdiscounts from smaller publishers.

    Amazon is pushing digital restrictions management (DRM) on ebooks,which is bad for everyone who reads books. Using this DRM, Amazon cancontrol how people read, and can even delete readers books (as they didwith copies of 1984). For more information about the dangers of DRM,please see "The Right to Read" and "The Danger of E-books" by RichardStallman at http://www.gnu.org/philosophy/right-to-read.html andhttp://www.gnu.org/philosophy/the-danger-of-ebooks.html, and thewebsite http://www.defectivebydesign.org/amazon-kindle-swindle.

    Digital versions of GNU books can downloaded from http://www.gnu.org andhttp://shop.fsf.org. All GNU Press books are distributed without DRM.

    Thank you again for your purchase. Please support us and other small publishersby not buying paper or electronic books from Amazon in the future.

  • iShort Contents

    Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    1 The Organization of the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2 Characters, Keys and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3 Entering and Exiting Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    4 Basic Editing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    5 The Minibuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    6 Running Commands by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    7 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    8 The Mark and the Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    9 Killing and Moving Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    10 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    11 Controlling the Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    12 Searching and Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    13 Commands for Fixing Typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    14 Keyboard Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    15 File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

    16 Using Multiple Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

    17 Multiple Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

    18 Frames and Graphical Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    19 International Character Set Support . . . . . . . . . . . . . . . . . . . . . . . . 180

    20 Major and Minor Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

    21 Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

    22 Commands for Human Languages . . . . . . . . . . . . . . . . . . . . . . . . . . 214

    23 Editing Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

    24 Compiling and Testing Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

    25 Maintaining Large Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

    26 Abbrevs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

    27 Dired, the Directory Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

    28 The Calendar and the Diary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

  • ii

    29 Sending Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

    30 Reading Mail with Rmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376

    31 Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

    32 Emacs Lisp Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430

    33 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434

    34 Dealing with Common Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468

    A GNU GENERAL PUBLIC LICENSE . . . . . . . . . . . . . . . . . . . . . . . 484

    B GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . . 496

    C Command Line Arguments for Emacs Invocation . . . . . . . . . . . . 505

    D X Options and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521

    E Emacs 23 Antinews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529

    F Emacs and Mac OS / GNUstep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531

    G Emacs and Microsoft Windows/MS-DOS . . . . . . . . . . . . . . . . . . . 535

    The GNU Manifesto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546

    Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555

    Key (Character) Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580

    Command and Function Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590

    Variable Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604

    Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612

  • iii

    Table of Contents

    Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    1 The Organization of the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.1 Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2 The Echo Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 The Mode Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4 The Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2 Characters, Keys and Commands . . . . . . . . . . . . . . . . . . . . . . . 112.1 Kinds of User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3 Keys and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    3 Entering and Exiting Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.1 Entering Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2 Exiting Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    4 Basic Editing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.1 Inserting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.2 Changing the Location of Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3 Erasing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.4 Undoing Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.5 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.6 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.7 Blank Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.8 Continuation Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.9 Cursor Position Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.10 Numeric Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.11 Repeating a Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

  • iv

    5 The Minibuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.1 Minibuffers for File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.2 Editing in the Minibuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285.3 Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    5.3.1 Completion Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.3.2 Completion Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.3.3 Completion Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315.3.4 How Completion Alternatives Are Chosen . . . . . . . . . . . . . . . . . . . . . . . 325.3.5 Completion Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    5.4 Minibuffer History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345.5 Repeating Minibuffer Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355.6 Entering passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    6 Running Commands by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    7 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.1 Documentation for a Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407.2 Help by Command or Variable Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407.3 Apropos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417.4 Help Mode Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437.5 Keyword Search for Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437.6 Help for International Language Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.7 Other Help Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.8 Help Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457.9 Help on Active Text and Tooltips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    8 The Mark and the Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478.1 Setting the Mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478.2 Commands to Mark Textual Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498.3 Operating on the Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508.4 The Mark Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518.5 The Global Mark Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518.6 Shift Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528.7 Disabling Transient Mark Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

  • v9 Killing and Moving Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549.1 Deletion and Killing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    9.1.1 Deletion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549.1.2 Killing by Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559.1.3 Other Kill Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569.1.4 Options for Killing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    9.2 Yanking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579.2.1 The Kill Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579.2.2 Yanking Earlier Kills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589.2.3 Appending Kills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    9.3 Cut and Paste Operations on Graphical Displays . . . . . . . . . . . . . . . . . . . 599.3.1 Using the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599.3.2 Cut and Paste with Other Window Applications . . . . . . . . . . . . . . . . 609.3.3 Secondary Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    9.4 Accumulating Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619.5 Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639.6 CUA Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

    10 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6610.1 Saving Positions in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6610.2 Saving Text in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6610.3 Saving Rectangles in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6710.4 Saving Window Configurations in Registers . . . . . . . . . . . . . . . . . . . . . . . . . 6710.5 Keeping Numbers in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6810.6 Keeping File Names in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6810.7 Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    11 Controlling the Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7011.1 Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7011.2 Recentering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7111.3 Automatic Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7211.4 Horizontal Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7311.5 Narrowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7411.6 View Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7511.7 Follow Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7511.8 Text Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7511.9 Colors for Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7611.10 Standard Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7711.11 Text Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7911.12 Font Lock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8011.13 Interactive Highlighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8111.14 Window Fringes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8311.15 Displaying Boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8311.16 Useless Whitespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8411.17 Selective Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

  • vi

    11.18 Optional Mode Line Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8511.19 How Text Is Displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8711.20 Displaying the Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8811.21 Line Truncation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.22 Visual Line Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.23 Customization of Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    12 Searching and Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9112.1 Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    12.1.1 Basics of Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9112.1.2 Repeating Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9212.1.3 Errors in Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9312.1.4 Special Input for Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . 9312.1.5 Isearch Yanking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9412.1.6 Scrolling During Incremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . 9412.1.7 Searching the Minibuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

    12.2 Nonincremental Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9512.3 Word Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9512.4 Regular Expression Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9612.5 Syntax of Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9712.6 Backslash in Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10012.7 Regular Expression Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10312.8 Searching and Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10312.9 Replacement Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

    12.9.1 Unconditional Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10412.9.2 Regexp Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10412.9.3 Replace Commands and Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10512.9.4 Query Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

    12.10 Other Search-and-Loop Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

    13 Commands for Fixing Typos . . . . . . . . . . . . . . . . . . . . . . . . . . 11013.1 Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11013.2 Transposing Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11113.3 Case Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11213.4 Checking and Correcting Spelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

    14 Keyboard Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11614.1 Basic Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11614.2 The Keyboard Macro Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11814.3 The Keyboard Macro Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11814.4 Executing Macros with Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12014.5 Naming and Saving Keyboard Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12114.6 Editing a Keyboard Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12214.7 Stepwise Editing a Keyboard Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

  • vii

    15 File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12415.1 File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12415.2 Visiting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12515.3 Saving Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

    15.3.1 Commands for Saving Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12815.3.2 Backup Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

    15.3.2.1 Single or Numbered Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13015.3.2.2 Automatic Deletion of Backups . . . . . . . . . . . . . . . . . . . . . . . . . . 13115.3.2.3 Copying vs. Renaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    15.3.3 Customizing Saving of Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13215.3.4 Protection against Simultaneous Editing . . . . . . . . . . . . . . . . . . . . . . 13315.3.5 Shadowing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13415.3.6 Updating Time Stamps Automatically . . . . . . . . . . . . . . . . . . . . . . . . 135

    15.4 Reverting a Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13515.5 Auto-Saving: Protection Against Disasters . . . . . . . . . . . . . . . . . . . . . . . . . 136

    15.5.1 Auto-Save Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13615.5.2 Controlling Auto-Saving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13715.5.3 Recovering Data from Auto-Saves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    15.6 File Name Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13815.7 File Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13915.8 Comparing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14015.9 Diff Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14115.10 Miscellaneous File Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14315.11 Accessing Compressed Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14415.12 File Archives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14415.13 Remote Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14515.14 Quoted File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14615.15 File Name Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14715.16 Convenience Features for Finding Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14815.17 Filesets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

    16 Using Multiple Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15016.1 Creating and Selecting Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15016.2 Listing Existing Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15216.3 Miscellaneous Buffer Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15216.4 Killing Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15316.5 Operating on Several Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15416.6 Indirect Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15616.7 Convenience Features and Customization of Buffer Handling . . . . . . . 157

    16.7.1 Making Buffer Names Unique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15716.7.2 Switching Between Buffers using Substrings . . . . . . . . . . . . . . . . . . . 15816.7.3 Customizing Buffer Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

  • viii

    17 Multiple Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15917.1 Concepts of Emacs Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15917.2 Splitting Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15917.3 Using Other Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16017.4 Displaying in Another Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16117.5 Deleting and Rearranging Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16217.6 Displaying a Buffer in a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

    17.6.1 How display-buffer works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16317.7 Convenience Features for Window Handling . . . . . . . . . . . . . . . . . . . . . . . . 164

    18 Frames and Graphical Displays . . . . . . . . . . . . . . . . . . . . . . . 16518.1 Mouse Commands for Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16518.2 Mouse Commands for Words and Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16718.3 Following References with the Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16718.4 Mouse Clicks for Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16818.5 Mode Line Mouse Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16918.6 Creating Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16918.7 Frame Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17018.8 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17118.9 Speedbar Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17418.10 Multiple Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17518.11 Frame Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17518.12 Scroll Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17618.13 Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17618.14 Menu Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17618.15 Tool Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17718.16 Using Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17718.17 Tooltips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17818.18 Mouse Avoidance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17818.19 Non-Window Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17918.20 Using a Mouse in Text Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

    19 International Character Set Support . . . . . . . . . . . . . . . . . 18019.1 Introduction to International Character Sets . . . . . . . . . . . . . . . . . . . . . . . 18019.2 Disabling Multibyte Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18219.3 Language Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18319.4 Input Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18519.5 Selecting an Input Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18619.6 Coding Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18819.7 Recognizing Coding Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19019.8 Specifying a Files Coding System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19219.9 Choosing Coding Systems for Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19219.10 Specifying a Coding System for File Text . . . . . . . . . . . . . . . . . . . . . . . . . 19319.11 Coding Systems for Interprocess Communication . . . . . . . . . . . . . . . . . . 19419.12 Coding Systems for File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

  • ix

    19.13 Coding Systems for Terminal I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19619.14 Fontsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19719.15 Defining fontsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19819.16 Modifying Fontsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19919.17 Undisplayable Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20019.18 Unibyte Editing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20019.19 Charsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20219.20 Bidirectional Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

    20 Major and Minor Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20420.1 Major Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20420.2 Minor Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20520.3 Choosing File Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

    21 Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21021.1 Indentation Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21021.2 Tab Stops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21121.3 Tabs vs. Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21221.4 Convenience Features for Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

    22 Commands for Human Languages . . . . . . . . . . . . . . . . . . . . 21422.1 Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21422.2 Sentences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21522.3 Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21622.4 Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21722.5 Filling Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    22.5.1 Auto Fill Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21822.5.2 Explicit Fill Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21922.5.3 The Fill Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22022.5.4 Adaptive Filling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

    22.6 Case Conversion Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22322.7 Text Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22322.8 Outline Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

    22.8.1 Format of Outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22522.8.2 Outline Motion Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22622.8.3 Outline Visibility Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22622.8.4 Viewing One Outline in Multiple Views . . . . . . . . . . . . . . . . . . . . . . . 22822.8.5 Folding Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

    22.9 Org Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22922.9.1 Org as an organizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23022.9.2 Org as an authoring system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

    22.10 TEX Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23122.10.1 TEX Editing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23222.10.2 LaTEX Editing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23322.10.3 TEX Printing Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

  • x22.10.4 TEX Mode Miscellany . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23522.11 SGML and HTML Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23622.12 Nroff Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23722.13 Enriched Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

    22.13.1 Enriched Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23822.13.2 Hard and Soft Newlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23822.13.3 Editing Format Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23922.13.4 Faces in Enriched Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23922.13.5 Indentation in Enriched Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24022.13.6 Justification in Enriched Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24122.13.7 Setting Other Text Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

    22.14 Editing Text-based Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24122.14.1 What is a Text-based Table? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24222.14.2 Creating a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24322.14.3 Table Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24322.14.4 Commands for Table Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24422.14.5 Cell Justification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24422.14.6 Table Rows and Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24522.14.7 Converting Between Plain Text and Tables . . . . . . . . . . . . . . . . . . 24522.14.8 Table Miscellany . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

    22.15 Two-Column Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    23 Editing Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24923.1 Major Modes for Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . 24923.2 Top-Level Definitions, or Defuns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

    23.2.1 Left Margin Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25023.2.2 Moving by Defuns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25123.2.3 Imenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25123.2.4 Which Function Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

    23.3 Indentation for Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25223.3.1 Basic Program Indentation Commands . . . . . . . . . . . . . . . . . . . . . . . . 25223.3.2 Indenting Several Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25323.3.3 Customizing Lisp Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25423.3.4 Commands for C Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25423.3.5 Customizing C Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

    23.4 Commands for Editing with Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . 25623.4.1 Expressions with Balanced Parentheses . . . . . . . . . . . . . . . . . . . . . . . 25623.4.2 Moving in the Parenthesis Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 25723.4.3 Matching Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

    23.5 Manipulating Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25823.5.1 Comment Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25923.5.2 Multiple Lines of Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26023.5.3 Options Controlling Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

    23.6 Documentation Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26123.6.1 Info Documentation Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26223.6.2 Man Page Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

  • xi

    23.6.3 Emacs Lisp Documentation Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . 26323.7 Hideshow minor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26323.8 Completion for Symbol Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26423.9 Glasses minor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26423.10 Semantic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26523.11 Other Features Useful for Editing Programs . . . . . . . . . . . . . . . . . . . . . . . 26523.12 C and Related Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266

    23.12.1 C Mode Motion Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26623.12.2 Electric C Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26723.12.3 Hungry Delete Feature in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26723.12.4 Other Commands for C Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268

    23.13 Asm Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

    24 Compiling and Testing Programs . . . . . . . . . . . . . . . . . . . . . 27124.1 Running Compilations under Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27124.2 Compilation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27224.3 Subshells for Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27424.4 Searching with Grep under Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27524.5 Finding Syntax Errors On The Fly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27624.6 Running Debuggers Under Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

    24.6.1 Starting GUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27624.6.2 Debugger Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27724.6.3 Commands of GUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27824.6.4 GUD Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28024.6.5 GDB Graphical Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281

    24.6.5.1 GDB User Interface Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28124.6.5.2 Source Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28224.6.5.3 Breakpoints Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28224.6.5.4 Threads Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28324.6.5.5 Stack Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28424.6.5.6 Other GDB Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28424.6.5.7 Watch Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28524.6.5.8 Multithreaded Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

    24.7 Executing Lisp Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28724.8 Libraries of Lisp Code for Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28724.9 Evaluating Emacs Lisp Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28824.10 Lisp Interaction Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29024.11 Running an External Lisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

  • xii

    25 Maintaining Large Programs . . . . . . . . . . . . . . . . . . . . . . . . . . 29225.1 Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

    25.1.1 Introduction to Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29225.1.1.1 Understanding the problems it addresses . . . . . . . . . . . . . . . . . 29225.1.1.2 Supported Version Control Systems . . . . . . . . . . . . . . . . . . . . . . 29325.1.1.3 Concepts of Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29325.1.1.4 Merge-based vs lock-based Version Control . . . . . . . . . . . . . . 29425.1.1.5 Changeset-based vs File-based Version Control . . . . . . . . . . . 29525.1.1.6 Decentralized vs Centralized Repositories . . . . . . . . . . . . . . . . 29525.1.1.7 Types of Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

    25.1.2 Version Control and the Mode Line . . . . . . . . . . . . . . . . . . . . . . . . . . . 29625.1.3 Basic Editing under Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . 296

    25.1.3.1 Basic Version Control with Merging . . . . . . . . . . . . . . . . . . . . . 29725.1.3.2 Basic Version Control with Locking . . . . . . . . . . . . . . . . . . . . . . 29825.1.3.3 Advanced Control in C-x v v . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

    25.1.4 Features of the Log Entry Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29925.1.5 Registering a File for Version Control . . . . . . . . . . . . . . . . . . . . . . . . . 30025.1.6 Examining And Comparing Old Revisions . . . . . . . . . . . . . . . . . . . . 30025.1.7 VC Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30225.1.8 Undoing Version Control Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30425.1.9 VC Directory Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

    25.1.9.1 The VC Directory Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30525.1.9.2 VC Directory Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

    25.1.10 Version Control Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30725.1.10.1 Switching between Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30725.1.10.2 Pulling Changes into a Branch . . . . . . . . . . . . . . . . . . . . . . . . . 30825.1.10.3 Merging Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30825.1.10.4 Creating New Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

    25.2 Change Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30925.2.1 Change Log Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31025.2.2 Format of ChangeLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

    25.3 Tags Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31125.3.1 Source File Tag Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31225.3.2 Creating Tags Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31425.3.3 Etags Regexps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31525.3.4 Selecting a Tags Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31725.3.5 Finding a Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31725.3.6 Searching and Replacing with Tags Tables . . . . . . . . . . . . . . . . . . . . 31825.3.7 Tags Table Inquiries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

    25.4 Emacs Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

  • xiii

    26 Abbrevs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32226.1 Abbrev Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32226.2 Defining Abbrevs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32226.3 Controlling Abbrev Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32326.4 Examining and Editing Abbrevs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32426.5 Saving Abbrevs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32526.6 Dynamic Abbrev Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32626.7 Customizing Dynamic Abbreviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

    27 Dired, the Directory Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 32927.1 Entering Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32927.2 Navigation in the Dired Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33027.3 Deleting Files with Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33027.4 Flagging Many Files at Once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33127.5 Visiting Files in Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33227.6 Dired Marks vs. Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33327.7 Operating on Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33527.8 Shell Commands in Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33727.9 Transforming File Names in Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33827.10 File Comparison with Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33927.11 Subdirectories in Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33927.12 Moving Over Subdirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34027.13 Hiding Subdirectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34027.14 Updating the Dired Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34127.15 Dired and find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34227.16 Editing the Dired Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34327.17 Viewing Image Thumbnails in Dired . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34327.18 Other Dired Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

    28 The Calendar and the Diary . . . . . . . . . . . . . . . . . . . . . . . . . . 34628.1 Movement in the Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

    28.1.1 Motion by Standard Lengths of Time . . . . . . . . . . . . . . . . . . . . . . . . . 34628.1.2 Beginning or End of Week, Month or Year . . . . . . . . . . . . . . . . . . . . 34728.1.3 Specified Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

    28.2 Scrolling in the Calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34828.3 Counting Days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34828.4 Miscellaneous Calendar Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34928.5 Writing Calendar Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34928.6 Holidays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35128.7 Times of Sunrise and Sunset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35228.8 Phases of the Moon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35328.9 Conversion To and From Other Calendars . . . . . . . . . . . . . . . . . . . . . . . . . . 353

    28.9.1 Supported Calendar Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35428.9.2 Converting To Other Calendars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35528.9.3 Converting From Other Calendars . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

  • xiv

    28.9.4 Converting from the Mayan Calendar . . . . . . . . . . . . . . . . . . . . . . . . . 35728.10 The Diary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

    28.10.1 Displaying the Diary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35928.10.2 The Diary File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36028.10.3 Date Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36028.10.4 Commands to Add to the Diary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36128.10.5 Special Diary Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

    28.11 Appointments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36428.12 Importing and Exporting Diary Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . 36428.13 Daylight Saving Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36528.14 Summing Time Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366

    29 Sending Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36729.1 The Format of the Mail Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36729.2 Mail Header Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36829.3 Mail Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37029.4 Mail Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

    29.4.1 Mail Sending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37029.4.2 Mail Header Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37229.4.3 Citing Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37329.4.4 Mail Miscellany . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

    29.5 Mail Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37429.6 Mail Amusements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37429.7 Mail-Composition Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375

    30 Reading Mail with Rmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37630.1 Basic Concepts of Rmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37630.2 Scrolling Within a Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37630.3 Moving Among Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37730.4 Deleting Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37830.5 Rmail Files and Inboxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37930.6 Multiple Rmail Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38030.7 Copying Messages Out to Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38130.8 Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38330.9 Rmail Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38430.10 Sending Replies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38530.11 Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386

    30.11.1 Making Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38730.11.2 Editing in Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388

    30.12 Sorting the Rmail File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39030.13 Display of Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39130.14 Rmail and Coding Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39230.15 Editing Within a Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39230.16 Digest Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39330.17 Reading Rot13 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

  • xv

    30.18 movemail program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39330.19 Retrieving Mail from Remote Mailboxes . . . . . . . . . . . . . . . . . . . . . . . . . . 39530.20 Retrieving Mail from Local Mailboxes in Various Formats . . . . . . . . . 396

    31 Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39731.1 Gnus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

    31.1.1 Gnus Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39731.1.2 When Gnus Starts Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39731.1.3 Using the Gnus Group Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39831.1.4 Using the Gnus Summary Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399

    31.2 Document Viewing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39931.2.1 DocView Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40031.2.2 DocView Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40031.2.3 DocView Slicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40031.2.4 DocView Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401

    31.3 Running Shell Commands from Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40131.3.1 Single Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40231.3.2 Interactive Subshell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40331.3.3 Shell Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40331.3.4 Shell Prompts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40631.3.5 Shell Command History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407

    31.3.5.1 Shell History Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40731.3.5.2 Shell History Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40831.3.5.3 Shell History References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

    31.3.6 Directory Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40931.3.7 Shell Mode Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40931.3.8 Emacs Terminal Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41031.3.9 Term Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41131.3.10 Remote Host Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41131.3.11 Serial Terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

    31.4 Using Emacs as a Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41231.4.1 Invoking emacsclient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41331.4.2 emacsclient Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414

    31.5 Printing Hard Copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41731.5.1 PostScript Hardcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41831.5.2 Variables for PostScript Hardcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41931.5.3 Printing Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420

    31.6 Sorting Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42031.7 Editing Binary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42231.8 Saving Emacs Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42331.9 Recursive Editing Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42431.10 Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42531.11 Hyperlinking and Navigation Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

    31.11.1 Following URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42631.11.2 Activating URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42631.11.3 Finding Files and URLs at Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427

  • xvi

    31.12 Other Amusements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428

    32 Emacs Lisp Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43032.1 The Package Menu Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43032.2 Package Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43132.3 Package Files and Directory Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432

    33 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43433.1 Easy Customization Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434

    33.1.1 Customization Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43433.1.2 Browsing and Searching for Settings . . . . . . . . . . . . . . . . . . . . . . . . . . 43533.1.3 Changing a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43633.1.4 Saving Customizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43833.1.5 Customizing Faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43933.1.6 Customizing Specific Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44033.1.7 Custom Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44133.1.8 Creating Custom Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442

    33.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44333.2.1 Examining and Setting Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44333.2.2 Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44533.2.3 Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44633.2.4 Local Variables in Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447

    33.2.4.1 Specifying File Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44733.2.4.2 Safety of File Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

    33.2.5 Per-Directory Local Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45033.3 Customizing Key Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452

    33.3.1 Keymaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45233.3.2 Prefix Keymaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45333.3.3 Local Keymaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45333.3.4 Minibuffer Keymaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45433.3.5 Changing Key Bindings Interactively . . . . . . . . . . . . . . . . . . . . . . . . . 45433.3.6 Rebinding Keys in Your Init File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45533.3.7 Modifier Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45633.3.8 Rebinding Function Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45733.3.9 Named ASCII Control Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45833.3.10 Rebinding Mouse Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45933.3.11 Disabling Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460

    33.4 The Emacs Initialization File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46133.4.1 Init File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46233.4.2 Init File Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46333.4.3 Terminal-specific Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46533.4.4 How Emacs Finds Your Init File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46633.4.5 Non-ASCII Characters in Init Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466

  • xvii

    34 Dealing with Common Problems . . . . . . . . . . . . . . . . . . . . . . 46834.1 Quitting and Aborting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46834.2 Dealing with Emacs Trouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469

    34.2.1 If DEL Fails to Delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47034.2.2 Recursive Editing Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47034.2.3 Garbage on the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47034.2.4 Garbage in the Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47134.2.5 Running out of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47134.2.6 Recovery After a Crash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47134.2.7 Emergency Escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472

    34.3 Reporting Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47334.3.1 Reading Existing Bug Reports and Known Problems . . . . . . . . . . 47334.3.2 When Is There a Bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47434.3.3 Understanding Bug Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47534.3.4 Checklist for Bug Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47534.3.5 Sending Patches for GNU Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481

    34.4 Contributing to Emacs Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48334.5 How To Get Help with GNU Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

    Appendix A GNU GENERAL PUBLIC LICENSE . . . . 484

    Appendix B GNU Free Documentation License . . . . . . . . 496

    Appendix C Command Line Arguments for Emacs

    Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505C.1 Action Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505C.2 Initial Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507C.3 Command Argument Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509C.4 Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509

    C.4.1 General Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510C.4.2 Miscellaneous Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513C.4.3 The MS-Windows System Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

    C.5 Specifying the Display Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514C.6 Font Specification Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515C.7 Window Color Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515C.8 Options for Window Size and Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517C.9 Internal and External Borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518C.10 Frame Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519C.11 Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519C.12 Other Display Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519

  • xviii

    Appendix D X Options and Resources . . . . . . . . . . . . . . . . . . 521D.1 X Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521D.2 Table of X Resources for Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522D.3 GTK resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523

    D.3.1 GTK Resource Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524D.3.2 GTK widget names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525D.3.3 GTK Widget Names in Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525D.3.4 GTK styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526

    Appendix E Emacs 23 Antinews . . . . . . . . . . . . . . . . . . . . . . . . . 529

    Appendix F Emacs and Mac OS / GNUstep . . . . . . . . . . . 531F.1 Basic Emacs usage under Mac OS and GNUstep . . . . . . . . . . . . . . . . . . . . 531

    F.1.1 Grabbing environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531F.2 Mac / GNUstep Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532

    F.2.1 Font and Color Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532F.2.2 Customization options specific to Mac OS / GNUstep . . . . . . . . . . 532

    F.3 Windowing System Events under Mac OS / GNUstep . . . . . . . . . . . . . . . 532F.4 GNUstep Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534

    Appendix G Emacs and Microsoft Windows/MS-DOS

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535G.1 How to Start Emacs on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535G.2 Text Files and Binary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536G.3 File Names on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538G.4 Emulation of ls on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538G.5 HOME and Startup Directories on MS-Windows . . . . . . . . . . . . . . . . . . . . 538G.6 Keyboard Usage on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539G.7 Mouse Usage on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540G.8 Subprocesses on Windows 9X/ME and Windows NT/2K/XP . . . . . . . 540G.9 Printing and MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541G.10 Specifying Fonts on MS-Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543G.11 Miscellaneous Windows-specific features . . . . . . . . . . . . . . . . . . . . . . . . . . . 545

    The GNU Manifesto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546Whats GNU? Gnus Not Unix! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546Why I Must Write GNU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547Why GNU Will Be Compatible with Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547How GNU Will Be Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547Why Many Other Programmers Want to Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547How You Can Contribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548Why All Computer Users Will Benefit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548Some Easily Rebutted Objections to GNUs Goals . . . . . . . . . . . . . . . . . . . . . . . . 549

  • xix

    Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555

    Key (Character) Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580

    Command and Function Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590

    Variable Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604

    Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612

  • Preface 1

    Preface

    This manual documents the use and simple customization of the Emacs editor.Simple Emacs customizations do not require you to be a programmer, but if youare not interested in customizing, you can ignore the customization hints.

    This is primarily a reference manual, but can also be used as a primer. If youare new to Emacs, we recommend you start with the integrated, learn-by-doingtutorial, before reading the manual. To run the tutorial, start Emacs and type C-ht. The tutorial describes commands, tells you when to try them, and explains theresults. The tutorial is available in several languages.

    On first reading, just skim chapters 1 and 2, which describe the notationalconventions of the manual and the general appearance of the Emacs display screen.Note which questions are answered in these chapters, so you can refer back later.After reading chapter 4, you should practice the commands shown there. The nextfew chapters describe fundamental techniques and concepts that are used constantly.You need to understand them thoroughly, so experiment with them until you arefluent.

    Chapters 14 through 19 describe intermediate-level features that are useful formany kinds of editing. Chapter 20 and following chapters describe optional butuseful features; read those chapters when you need them.

    Read the Common Problems chapter if Emacs does not seem to be workingproperly. It explains how to cope with several common problems (see Section 34.2[Dealing with Emacs Trouble], page 469), as well as when and how to report Emacsbugs (see Section 34.3 [Bugs], page 473).

    To find the documentation of a particular command, look in the index. Keys(character commands) and command names have separate indexes. There is also aglossary, with a cross reference for each term.

    This manual is available as a printed book and also as an Info file. The Infofile is for reading from Emacs itself, or with the Info program. Info is the principalformat for documentation in the GNU system. The Info file and the printed bookcontain substantially the same text and are generated from the same source files,which are also distributed with GNU Emacs.

    GNU Emacs is a member of the Emacs editor family. There are many Emacseditors, all sharing common principles of organization. For information on theunderlying philosophy of Emacs and the lessons learned from its development, seeEmacs, the Extensible, Customizable Self-Documenting Display Editor, availablefrom ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf.

    This version of the manual is mainly intended for use with GNU Emacs installedon GNU and Unix systems. GNU Emacs can also be used on MS-DOS, MicrosoftWindows, and Macintosh systems. The Info file version of this manual containssome more information about using Emacs on those systems. Those systems usedifferent file name syntax; in addition MS-DOS does not support all GNU Emacsfeatures. See Appendix G [Microsoft Windows], page 535, for information aboutusing Emacs on Windows. See Appendix F [Mac OS / GNUstep], page 531, forinformation about using Emacs on Macintosh (and GNUstep).

  • Distribution 2

    Distribution

    GNU Emacs is free software; this means that everyone is free to use it and free toredistribute it under certain conditions. GNU Emacs is not in the public domain;it is copyrighted and there are restrictions on its distribution, but these restrictionsare designed to permit everything that a good cooperating citizen would want todo. What is not allowed is to try to prevent others from further sharing any versionof GNU Emacs that they might get from you. The precise conditions are found inthe GNU General Public License that comes with Emacs and also appears in thismanual1. See Appendix A [Copying], page 484.

    One way to get a copy of GNU Emacs is from someone else who has it. You neednot ask for our permission to do so, or tell any one else; just copy it. If you haveaccess to the Internet, you can get the latest distribution version of GNU Emacsby anonymous FTP; see http://www.gnu.org/software/emacs on our website formore information.

    You may also receive GNU Emacs when you buy a computer. Computer manu-facturers are free to distribute copies on the same terms that apply to everyone else.These terms require them to give you the full sources, including whatever changesthey may have made, and to permit you to redistribute the GNU Emacs receivedfrom them under the usual terms of the General Public License. In other words, theprogram must be free for you when you get it, not just free for the manufacturer.

    If you find GNU Emacs useful, please send a donation to the Free SoftwareFoundation to support our work. Donations to the Free Software Foundation aretax deductible in the US. If you use GNU Emacs at your workplace, please suggestthat the company make a donation. For more information on how you can help,see http://www.gnu.org/help/help.html.

    We also sell hardcopy versions of this manual and An Introduction to Program-ming in Emacs Lisp, by Robert J. Chassell. You can visit our online store athttp://shop.fsf.org/. The income from sales goes to support the foundationspurpose: the development of new free software, and improvements to our existingprograms including GNU Emacs.

    To contact the FSF, go to http://www.fsf.org/about/contact/, or write to

    Free Software Foundation51 Franklin Street, Fifth FloorBoston, MA 02110-1301USA

    Acknowledgments

    Contributors to GNU Emacs include Jari Aalto, Per Abrahamsen, Tomas Abra-hamsson, Jay K. Adams, Alon Albert, Michael Albinus, Nagy Andras, BenjaminAndresen, Ralf Angeli, Joe Arceneaux, Emil Astrom, Miles Bader, David Bakhash,

    1 This manual is itself covered by the GNU Free Documentation License. This license issimilar in spirit to the General Public License, but is more suitable for documentation.See Appendix B [GNU Free Documentation License], page 496.

  • Distribution 3

    Juanma Barranquero, Eli Barzilay, Thomas Baumann, Steven L. Baur, Jay Be-langer, Alexander L. Belikoff, Thomas Bellman, Scott Bender, Boaz Ben-Zvi, SergeyBerezin, Karl Berry, Anna M. Bigatti, Ray Blaak, Martin Blais, Jim Blandy, Jo-han Bockgard, Jan Bocker, Joel Boehland, Lennart Borgman, Per Bothner, Ter-rence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin Broadey, Vin-cent Broman, Michael Brouwer, David M. Brown, Stefan Bruda, Georges Brun-Cottan, Joe Buehler, Scott Byer, W lodek Bzyl, Bill Carpenter, Per Cederqvist,Hans Chalupsky, Chris Chase, Bob Chassell, Andrew Choi, Chong Yidong, SachaChua, Stewart Clamen, James Clark, Mike Clarkson, Glynn Clements, Andrew Co-hen, Daniel Colascione, Edward OConnor, Christoph Conrad, Ludovic Courte`s,Andrew Csillag, Toby Cubitt, Baoqiu Cui, Doug Cutting, Mathias Dahl, JulienDanjou, Satyaki Das, Vivek Dasmohapatra, Dan Davison, Michael DeCorte, GaryDelp, Nachum Dershowitz, Dave Detlefs, Matthieu Devin, Christophe de Dinechin,Eri Ding, Jan Djarv, Lawrence R. Dodd, Carsten Dominik, Scott Draves, Ben-jamin Drieu, Viktor Dukhovni, Jacques Duthen, Dmitry Dzhus, John Eaton, RolfEbert, Carl Edman, David Edmondson, Paul Eggert, Stephen Eglen, ChristianEgli, Torbjorn Einarsson, Tsugutomo Enami, David Engster, Hans Henrik Erik-sen, Michael Ernst, Ata Etemadi, Frederick Farnbach, Oscar Figueiredo, Fred Fish,Steve Fisk, Karl Fogel, Gary Foster, Eric S. Fraga, Romain Francoise, Noah Fried-man, Andreas Fuchs, Shigeru Fukaya, Hallvard Furuseth, Keith Gabryelski, PeterS. Galbraith, Kevin Gallagher, Kevin Gallo, Juan Leon Lahoz Garca, HowardGayle, Daniel German, Stephen Gildea, Julien Gilles, David Gillespie, Bob Glick-stein, Deepak Goel, David De La Harpe Golden, Boris Goldowsky, David Goodger,Chris Gray, Kevin Greiner, Michelangelo Grigni, Odd Gripenstam, Kai Grojohann,Michael Gschwind, Bastien Guerry, Henry Guillaume, Doug Gwyn, Bruno Haible,Kenichi Handa, Lars Hansen, Chris Hanson, Jesper