GNU Emacs Manual
Total Page:16
File Type:pdf, Size:1020Kb
GNU Emacs Manual GNU Emacs Manual Sixteenth Edition, Updated for Emacs Version 22.1. Richard Stallman This is the Sixteenth edition of the GNU Emacs Manual, updated for Emacs version 22.1. Copyright c 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being \The GNU Manifesto," \Distribution" and \GNU GENERAL PUBLIC LICENSE," with the Front-Cover texts being \A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled \GNU Free Documentation License." (a) The FSF's Back-Cover Text is: \You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development." Published by the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA ISBN 1-882114-86-8 Cover art by Etienne Suvasa. i Short 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 ::::::::::::::::::::::::::: 15 4 Basic Editing Commands :::::::::::::::::::::::::::::: 18 5 The Minibuffer :::::::::::::::::::::::::::::::::::::: 28 6 Running Commands by Name :::::::::::::::::::::::::: 35 7 Help ::::::::::::::::::::::::::::::::::::::::::::::: 36 8 The Mark and the Region ::::::::::::::::::::::::::::: 45 9 Killing and Moving Text :::::::::::::::::::::::::::::: 51 10 Registers ::::::::::::::::::::::::::::::::::::::::::: 60 11 Controlling the Display ::::::::::::::::::::::::::::::: 64 12 Searching and Replacement :::::::::::::::::::::::::::: 80 13 Commands for Fixing Typos ::::::::::::::::::::::::::: 97 14 Keyboard Macros ::::::::::::::::::::::::::::::::::: 103 15 File Handling :::::::::::::::::::::::::::::::::::::: 111 16 Using Multiple Buffers ::::::::::::::::::::::::::::::: 145 17 Multiple Windows ::::::::::::::::::::::::::::::::::: 154 18 Frames and Graphical Displays :::::::::::::::::::::::: 159 19 International Character Set Support :::::::::::::::::::: 173 20 Major Modes ::::::::::::::::::::::::::::::::::::::: 192 21 Indentation :::::::::::::::::::::::::::::::::::::::: 195 22 Commands for Human Languages :::::::::::::::::::::: 198 23 Editing Programs ::::::::::::::::::::::::::::::::::: 233 24 Compiling and Testing Programs::::::::::::::::::::::: 254 25 Maintaining Large Programs :::::::::::::::::::::::::: 272 26 Abbrevs ::::::::::::::::::::::::::::::::::::::::::: 282 27 Sending Mail ::::::::::::::::::::::::::::::::::::::: 288 28 Reading Mail with Rmail ::::::::::::::::::::::::::::: 297 29 Dired, the Directory Editor ::::::::::::::::::::::::::: 315 30 The Calendar and the Diary :::::::::::::::::::::::::: 329 31 Miscellaneous Commands ::::::::::::::::::::::::::::: 349 32 Customization :::::::::::::::::::::::::::::::::::::: 377 ii 33 Dealing with Common Problems ::::::::::::::::::::::: 409 A GNU GENERAL PUBLIC LICENSE ::::::::::::::::::: 423 B GNU Free Documentation License :::::::::::::::::::::: 429 C Command Line Arguments for Emacs Invocation :::::::::: 436 D X Options and Resources ::::::::::::::::::::::::::::: 452 E Emacs 21 Antinews :::::::::::::::::::::::::::::::::: 458 F Emacs and Mac OS ::::::::::::::::::::::::::::::::: 462 G Emacs and Microsoft Windows/MS-DOS :::::::::::::::: 467 The GNU Manifesto ::::::::::::::::::::::::::::::::::::: 474 Glossary :::::::::::::::::::::::::::::::::::::::::::::: 482 Key (Character) Index ::::::::::::::::::::::::::::::::::: 504 Command and Function Index :::::::::::::::::::::::::::: 512 Variable Index ::::::::::::::::::::::::::::::::::::::::: 523 Concept Index ::::::::::::::::::::::::::::::::::::::::: 529 iii Table of Contents Preface :::::::::::::::::::::::::::::::::::::::::::::: 1 Distribution ::::::::::::::::::::::::::::::::::::::::: 2 Acknowledgments ::::::::::::::::::::::::::::::::::::::::::::::::::: 2 Introduction :::::::::::::::::::::::::::::::::::::::: 5 1 The Organization of the Screen ::::::::::::::: 6 1.1 Point :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 1.2 The Echo Area ::::::::::::::::::::::::::::::::::::::::::::::::: 7 1.3 The Mode Line::::::::::::::::::::::::::::::::::::::::::::::::: 8 1.4 The Menu Bar :::::::::::::::::::::::::::::::::::::::::::::::: 10 2 Characters, Keys and Commands :::::::::::: 11 2.1 Kinds of User Input ::::::::::::::::::::::::::::::::::::::::::: 11 2.2 Keys :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 2.3 Keys and Commands:::::::::::::::::::::::::::::::::::::::::: 13 2.4 Character Set for Text :::::::::::::::::::::::::::::::::::::::: 14 3 Entering and Exiting Emacs :::::::::::::::::: 15 3.1 Exiting Emacs :::::::::::::::::::::::::::::::::::::::::::::::: 15 4 Basic Editing Commands ::::::::::::::::::::: 18 4.1 Inserting Text::::::::::::::::::::::::::::::::::::::::::::::::: 18 4.2 Changing the Location of Point ::::::::::::::::::::::::::::::: 19 4.3 Erasing Text :::::::::::::::::::::::::::::::::::::::::::::::::: 21 4.4 Undoing Changes ::::::::::::::::::::::::::::::::::::::::::::: 21 4.5 Files :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 4.6 Help :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 4.7 Blank Lines ::::::::::::::::::::::::::::::::::::::::::::::::::: 22 4.8 Continuation Lines :::::::::::::::::::::::::::::::::::::::::::: 23 4.9 Cursor Position Information ::::::::::::::::::::::::::::::::::: 23 4.10 Numeric Arguments:::::::::::::::::::::::::::::::::::::::::: 25 4.11 Repeating a Command::::::::::::::::::::::::::::::::::::::: 26 iv 5 The Minibuffer :::::::::::::::::::::::::::::::: 28 5.1 Minibuffers for File Names :::::::::::::::::::::::::::::::::::: 28 5.2 Editing in the Minibuffer :::::::::::::::::::::::::::::::::::::: 29 5.3 Completion ::::::::::::::::::::::::::::::::::::::::::::::::::: 30 5.3.1 Completion Example ::::::::::::::::::::::::::::::::::::: 30 5.3.2 Completion Commands::::::::::::::::::::::::::::::::::: 30 5.3.3 Strict Completion :::::::::::::::::::::::::::::::::::::::: 31 5.3.4 Completion Options :::::::::::::::::::::::::::::::::::::: 32 5.4 Minibuffer History :::::::::::::::::::::::::::::::::::::::::::: 32 5.5 Repeating Minibuffer Commands :::::::::::::::::::::::::::::: 33 6 Running Commands by Name ::::::::::::::: 35 7 Help :::::::::::::::::::::::::::::::::::::::::::: 36 7.1 Documentation for a Key ::::::::::::::::::::::::::::::::::::: 38 7.2 Help by Command or Variable Name :::::::::::::::::::::::::: 38 7.3 Apropos :::::::::::::::::::::::::::::::::::::::::::::::::::::: 39 7.4 Help Mode Commands :::::::::::::::::::::::::::::::::::::::: 41 7.5 Keyword Search for Lisp Libraries ::::::::::::::::::::::::::::: 41 7.6 Help for International Language Support :::::::::::::::::::::: 42 7.7 Other Help Commands:::::::::::::::::::::::::::::::::::::::: 42 7.8 Help Files::::::::::::::::::::::::::::::::::::::::::::::::::::: 43 7.9 Help on Active Text and Tooltips ::::::::::::::::::::::::::::: 44 8 The Mark and the Region :::::::::::::::::::: 45 8.1 Setting the Mark:::::::::::::::::::::::::::::::::::::::::::::: 45 8.2 Transient Mark Mode ::::::::::::::::::::::::::::::::::::::::: 46 8.3 Using Transient Mark Mode Momentarily ::::::::::::::::::::: 48 8.4 Operating on the Region :::::::::::::::::::::::::::::::::::::: 48 8.5 Commands to Mark Textual Objects :::::::::::::::::::::::::: 48 8.6 The Mark Ring ::::::::::::::::::::::::::::::::::::::::::::::: 49 8.7 The Global Mark Ring :::::::::::::::::::::::::::::::::::::::: 50 9 Killing and Moving Text:::::::::::::::::::::: 51 9.1 Deletion and Killing::::::::::::::::::::::::::::::::::::::::::: 51 9.1.1 Deletion ::::::::::::::::::::::::::::::::::::::::::::::::: 51 9.1.2 Killing by Lines :::::::::::::::::::::::::::::::::::::::::: 52 9.1.3 Other Kill Commands :::::::::::::::::::::::::::::::::::: 53 9.2 Yanking :::::::::::::::::::::::::::::::::::::::::::::::::::::: 53 9.2.1 The Kill Ring :::::::::::::::::::::::::::::::::::::::::::: 54 9.2.2 Appending Kills:::::::::::::::::::::::::::::::::::::::::: 54 9.2.3 Yanking Earlier Kills ::::::::::::::::::::::::::::::::::::: 55 9.3 Accumulating Text:::::::::::::::::::::::::::::::::::::::::::: 56 9.4 Rectangles :::::::::::::::::::::::::::::::::::::::::::::::::::: 57 9.5 CUA Bindings :::::::::::::::::::::::::::::::::::::::::::::::: 58 v 10 Registers :::::::::::::::::::::::::::::::::::::: 60 10.1 Saving Positions in Registers ::::::::::::::::::::::::::::::::: 60 10.2 Saving Text in Registers ::::::::::::::::::::::::::::::::::::: 60 10.3 Saving Rectangles in Registers ::::::::::::::::::::::::::::::: 61 10.4 Saving Window Configurations in Registers::::::::::::::::::: 61 10.5 Keeping Numbers in Registers:::::::::::::::::::::::::::::::: 61 10.6 Keeping File Names in Registers ::::::::::::::::::::::::::::: 62 10.7 Bookmarks :::::::::::::::::::::::::::::::::::::::::::::::::: 62 11 Controlling the Display :::::::::::::::::::::: 64 11.1 Scrolling ::::::::::::::::::::::::::::::::::::::::::::::::::::: 64 11.2 Automatic Scrolling :::::::::::::::::::::::::::::::::::::::::: 65 11.3 Horizontal Scrolling :::::::::::::::::::::::::::::::::::::::::: 66 11.4 Follow Mode :::::::::::::::::::::::::::::::::::::::::::::::::