GNU Emacs Manual - Table of Contents

# GNU Emacs Manual

Emacs is the extensible, customizable, self-documenting real-time display editor. This Info file describes how to edit with Emacs and some of how to customize it; it corresponds to GNU Emacs version 20.7. For information on extending Emacs, see section `' in @cite{The Emacs Lisp Reference Manual}.

# Preface

This manual documents the use and simple customization of the Emacs editor. The reader is not expected to be a programmer; simple customizations do not require programming skill. But the user who is not interested in customizing can ignore the scattered customization hints.

This is primarily a reference manual, but can also be used as a primer. For complete beginners, it is a good idea to start with the on-line, learn-by-doing tutorial, before reading the manual. To run the tutorial, start Emacs and type `C-h t`. This way you can learn Emacs by using Emacs on a specially designed file which describes commands, tells you when to try them, and then explains the results you see.

On first reading, just skim chapters 1 and 2, which describe the notational conventions 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 there. The next few chapters describe fundamental techniques and concepts that are used constantly. You need to understand them thoroughly, experimenting with them if necessary.

Chapters 14 through 19 describe intermediate-level features that are useful for all kinds of editing. Chapter 20 and following chapters describe features that you may or may not want to use; read those chapters when you need them.

Read the Trouble chapter if Emacs does not seem to be working properly. It explains how to cope with some common problems (see section Dealing with Emacs Trouble), as well as when and how to report Emacs bugs (see section Reporting Bugs). To find the documentation on a particular command, look in the index. Keys (character commands) and command names have separate indexes. There is also a glossary, with a cross reference for each term.

This manual is available as a printed book and also as an Info file. The Info file is for on-line perusal with the Info program, which will be the principal way of viewing documentation on-line in the GNU system. Both the Info file and the Info program itself are distributed along with GNU Emacs. The Info file and the printed book contain substantially the same text and are generated from the same source files, which are also distributed along with GNU Emacs.

GNU Emacs is a member of the Emacs editor family. There are many Emacs editors, all sharing common principles of organization. For information on the underlying philosophy of Emacs and the lessons learned from its development, write for a copy of AI memo 519a, "Emacs, the Extensible, Customizable Self-Documenting Display Editor," to Publications Department, Artificial Intelligence Lab, 545 Tech Square, Cambridge, MA 02139, USA. At last report they charge $2.25 per copy. Another useful publication is LCS TM-165, "A Cookbook for an Emacs," by Craig Finseth, available from Publications Department, Laboratory for Computer Science, 545 Tech Square, Cambridge, MA 02139, USA. The price today is $3.

This edition of the manual is intended for use with GNU Emacs installed on GNU and Unix systems. GNU Emacs can also be used on VMS, MS-DOS (also called MS-DOG), Windows NT, and Windows 95 systems. Those systems use different file name syntax; in addition, VMS and MS-DOS do not support all GNU Emacs features. We don't try to describe VMS usage in this manual. See section Emacs and MS-DOS, for information about using Emacs on MS-DOS.

- Preface
- Distribution
- GNU GENERAL PUBLIC LICENSE
  - Preamble
  - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  - How to Apply These Terms to Your New Programs
- Introduction
- The Organization of the Screen
  - Point
  - The Echo Area
  - The Mode Line
  - The Menu Bar
- Characters, Keys and Commands
  - Kinds of User Input
  - Keys
  - Keys and Commands
  - Character Set for Text
- Entering and Exiting Emacs
  - Exiting Emacs
- Basic Editing Commands
  - Inserting Text
  - Changing the Location of Point
  - Erasing Text
  - Undoing Changes
  - Files
  - Help
  - Blank Lines
  - Continuation Lines
  - Cursor Position Information
  - Numeric Arguments
  - Repeating a Command
- The Minibuffer
  - Minibuffers for File Names
  - Editing in the Minibuffer
  - Completion
    - Completion Example
    - Completion Commands
    - Strict Completion
    - Completion Options
  - Minibuffer History
  - Repeating Minibuffer Commands
- Running Commands by Name
- Help
  - Documentation for a Key
  - Help by Command or Variable Name
  - Apropos
  - Keyword Search for Lisp Libraries
  - Help for International Language Support
  - Help Mode Commands
  - Other Help Commands
- The Mark and the Region
  - Setting the Mark
  - Transient Mark Mode
  - Operating on the Region
  - Commands to Mark Textual Objects
  - The Mark Ring
  - The Global Mark Ring
- Killing and Moving Text
  - Deletion and Killing
    - Deletion
    - Killing by Lines
    - Other Kill Commands
  - Yanking
    - The Kill Ring
    - Appending Kills
    - Yanking Earlier Kills
  - Accumulating Text
  - Rectangles
- Registers
  - Saving Positions in Registers
  - Saving Text in Registers
  - Saving Rectangles in Registers
  - Saving Window Configurations in Registers
  - Keeping Numbers in Registers
  - Keeping File Names in Registers
  - Bookmarks
- Controlling the Display
  - Scrolling
  - Horizontal Scrolling
  - Follow Mode
  - Selective Display
  - Optional Mode Line Features
  - How Text Is Displayed
  - Variables Controlling Display
- Searching and Replacement
  - Incremental Search
    - Slow Terminal Incremental Search
  - Nonincremental Search
  - Word Search
  - Regular Expression Search
  - Syntax of Regular Expressions
  - Searching and Case
  - Replacement Commands
    - Unconditional Replacement
    - Regexp Replacement
    - Replace Commands and Case
    - Query Replace
  - Other Search-and-Loop Commands
- Commands for Fixing Typos
  - Killing Your Mistakes
  - Transposing Text
  - Case Conversion
  - Checking and Correcting Spelling
- File Handling
  - File Names
  - Visiting Files
  - Saving Files
    - Backup Files
      - Single or Numbered Backups
      - Automatic Deletion of Backups
      - Copying vs. Renaming
    - Protection against Simultaneous Editing
  - Reverting a Buffer
  - Auto-Saving: Protection Against Disasters
    - Auto-Save Files
    - Controlling Auto-Saving
    - Recovering Data from Auto-Saves
  - File Name Aliases
  - Version Control
    - Introduction to Version Control
      - Supported Version Control Systems
      - Concepts of Version Control
    - Version Control and the Mode Line
    - Basic Editing under Version Control
      - Basic Version Control with Locking
      - Basic Version Control without Locking
      - Features of the Log Entry Buffer
    - Examining And Comparing Old Versions
    - The Secondary Commands of VC
      - Registering a File for Version Control
      - VC Status Commands
      - Undoing Version Control Actions
      - Dired under VC
      - VC Dired Commands
    - Multiple Branches of a File
      - Switching between Branches
      - Creating New Branches
      - Merging Branches
      - Multi-User Branching
    - Snapshots
      - Making and Using Snapshots
      - Snapshot Caveats
    - Miscellaneous Commands and Features of VC
      - Change Logs and VC
      - Renaming VC Work Files and Master Files
      - Inserting Version Control Headers
    - Customizing VC
      - Options for VC Backends
      - VC Workfile Handling
      - VC Status Retrieval
      - VC Command Execution
  - File Directories
  - Comparing Files
  - Miscellaneous File Operations
  - Accessing Compressed Files
  - Remote Files
  - Quoted File Names
- Using Multiple Buffers
  - Creating and Selecting Buffers
  - Listing Existing Buffers
  - Miscellaneous Buffer Operations
  - Killing Buffers
  - Operating on Several Buffers
  - Indirect Buffers
- Multiple Windows
  - Concepts of Emacs Windows
  - Splitting Windows
  - Using Other Windows
  - Displaying in Another Window
  - Forcing Display in the Same Window
  - Deleting and Rearranging Windows
- Frames and X Windows
  - Mouse Commands for Editing
  - Secondary Selection
  - Following References with the Mouse
  - Mouse Clicks for Menus
  - Mode Line Mouse Commands
  - Creating Frames
  - Making and Using a Speedbar Frame
  - Multiple Displays
  - Special Buffer Frames
  - Setting Frame Parameters
  - Scroll Bars
  - Menu Bars
  - Using Multiple Typefaces
  - Font Lock mode
  - Font Lock Support Modes
    - Fast Lock Mode
    - Lazy Lock Mode
    - Fast Lock or Lazy Lock?
  - Highlight Changes Mode
  - Miscellaneous X Window Features
  - Non-Window Terminals
- International Character Set Support
  - Introduction to International Character Sets
  - Enabling Multibyte Characters
  - Language Environments
  - Input Methods
  - Selecting an Input Method
  - Unibyte and Multibyte Non-ASCII characters
  - Coding Systems
  - Recognizing Coding Systems
  - Specifying a Coding System
  - Fontsets
  - Defining fontsets
  - Single-byte European Character Support
- Major Modes
  - How Major Modes are Chosen
- Indentation
  - Indentation Commands and Techniques
  - Tab Stops
  - Tabs vs. Spaces
- Commands for Human Languages
  - Words
  - Sentences
  - Paragraphs
  - Pages
  - Filling Text
    - Auto Fill Mode
    - Explicit Fill Commands
    - The Fill Prefix
    - Adaptive Filling
  - Case Conversion Commands
  - Text Mode
  - Outline Mode
    - Format of Outlines
    - Outline Motion Commands
    - Outline Visibility Commands
    - Viewing One Outline in Multiple Views
  - TeX Mode
    - TeX Editing Commands
    - LaTeX Editing Commands
    - TeX Printing Commands
  - Nroff Mode
  - Editing Formatted Text
    - Requesting to Edit Formatted Text
    - Hard and Soft Newlines
    - Editing Format Information
    - Faces in Formatted Text
    - Colors in Formatted Text
    - Indentation in Formatted Text
    - Justification in Formatted Text
    - Setting Other Text Properties
    - Forcing Enriched Mode
- Editing Programs
  - Major Modes for Programming Languages
  - Lists and Sexps
  - List And Sexp Commands
  - Defuns
  - Indentation for Programs
    - Basic Program Indentation Commands
    - Indenting Several Lines
    - Customizing Lisp Indentation
    - Commands for C Indentation
    - Customizing C Indentation
      - Step 1--Syntactic Analysis
      - Step 2--Indentation Calculation
      - Changing Indentation Style
      - Syntactic Symbols
      - Variables for C Indentation
      - C Indentation Styles
  - Automatic Display Of Matching Parentheses
  - Manipulating Comments
    - Comment Commands
    - Multiple Lines of Comments
    - Options Controlling Comments
  - Editing Without Unbalanced Parentheses
  - Completion for Symbol Names
  - Which Function Mode
  - Documentation Commands
  - Change Logs
  - Tags Tables
    - Source File Tag Syntax
    - Creating Tags Tables
    - Selecting a Tags Table
    - Finding a Tag
    - Searching and Replacing with Tags Tables
    - Tags Table Inquiries
  - Merging Files with Emerge
    - Overview of Emerge
    - Submodes of Emerge
    - State of a Difference
    - Merge Commands
    - Exiting Emerge
    - Combining the Two Versions
    - Fine Points of Emerge
  - C and Related Modes
    - C Mode Motion Commands
    - Electric C Characters
    - Hungry Delete Feature in C
    - Other Commands for C Mode
    - Comments in C Modes
  - Fortran Mode
    - Motion Commands
    - Fortran Indentation
      - Fortran Indentation Commands
      - Continuation Lines
      - Line Numbers
      - Syntactic Conventions
      - Variables for Fortran Indentation
    - Fortran Comments
    - Fortran Auto Fill Mode
    - Checking Columns in Fortran
    - Fortran Keyword Abbrevs
    - Other Fortran Mode Commands
  - Asm Mode
- Compiling and Testing Programs
  - Running Compilations under Emacs
  - Searching with Grep under Emacs
  - Compilation Mode
  - Subshells for Compilation
  - Running Debuggers Under Emacs
    - Starting GUD
    - Debugger Operation
    - Commands of GUD
    - GUD Customization
  - Executing Lisp Expressions
  - Libraries of Lisp Code for Emacs
  - Evaluating Emacs-Lisp Expressions
  - Lisp Interaction Buffers
  - Running an External Lisp
- Abbrevs
  - Abbrev Concepts
  - Defining Abbrevs
  - Controlling Abbrev Expansion
  - Examining and Editing Abbrevs
  - Saving Abbrevs
  - Dynamic Abbrev Expansion
  - Customizing Dynamic Abbreviation
- Editing Pictures
  - Basic Editing in Picture Mode
  - Controlling Motion after Insert
  - Picture Mode Tabs
  - Picture Mode Rectangle Commands
- Sending Mail
  - The Format of the Mail Buffer
  - Mail Header Fields
  - Mail Aliases
  - Mail Mode
    - Mail Sending
    - Mail Header Editing
    - Citing Mail
    - Mail Mode Miscellany
  - Distracting the NSA
  - Mail-Composition Methods
- Reading Mail with Rmail
  - Basic Concepts of Rmail
  - Scrolling Within a Message
  - Moving Among Messages
  - Deleting Messages
  - Rmail Files and Inboxes
  - Multiple Rmail Files
  - Copying Messages Out to Files
  - Labels
  - Rmail Attributes
  - Sending Replies
  - Summaries
    - Making Summaries
    - Editing in Summaries
  - Sorting the Rmail File
  - Display of Messages
  - Editing Within a Message
  - Digest Messages
  - Converting an Rmail File to Inbox Format
  - Reading Rot13 Messages
  - `movemail` and POP
- Dired, the Directory Editor
  - Entering Dired
  - Commands in the Dired Buffer
  - Deleting Files with Dired
  - Flagging Many Files at Once
  - Visiting Files in Dired
  - Dired Marks vs. Flags
  - Operating on Files
  - Shell Commands in Dired
  - Transforming File Names in Dired
  - File Comparison with Dired
  - Subdirectories in Dired
  - Moving Over Subdirectories
  - Hiding Subdirectories
  - Updating the Dired Buffer
  - Dired and `find`
- The Calendar and the Diary
  - Movement in the Calendar
    - Motion by Standard Lengths of Time
    - Beginning or End of Week, Month or Year
    - Specified Dates
  - Scrolling in the Calendar
  - Counting Days
  - Miscellaneous Calendar Commands
  - LaTeX Calendar
  - Holidays
  - Times of Sunrise and Sunset
  - Phases of the Moon
  - Conversion To and From Other Calendars
    - Supported Calendar Systems
    - Converting To Other Calendars
    - Converting From Other Calendars
    - Converting from the Mayan Calendar
  - The Diary
    - Commands Displaying Diary Entries
    - The Diary File
    - Date Formats
    - Commands to Add to the Diary
    - Special Diary Entries
  - Appointments
  - Daylight Savings Time
- Miscellaneous Commands
  - Gnus
    - Gnus Buffers
    - When Gnus Starts Up
    - Summary of Gnus Commands
  - Running Shell Commands from Emacs
    - Single Shell Commands
    - Interactive Inferior Shell
    - Shell Mode
    - Shell Command History
      - Shell History Ring
      - Shell History Copying
      - Shell History References
    - Shell Mode Options
    - Remote Host Shell
  - Using Emacs as a Server
  - Hardcopy Output
  - Postscript Hardcopy
  - Variables for Postscript Hardcopy
  - Sorting Text
  - Narrowing
  - Two-Column Editing
  - Editing Binary Files
  - Saving Emacs Sessions
  - Recursive Editing Levels
  - Emulation
  - Dissociated Press
  - Other Amusements
- Customization
  - Minor Modes
  - Variables
    - Examining and Setting Variables
    - Easy Customization Interface
      - Customization Groups
      - Changing an Option
      - Customizing Faces
      - Customizing Specific Items
    - Hooks
    - Local Variables
    - Local Variables in Files
  - Keyboard Macros
    - Basic Use
    - Naming and Saving Keyboard Macros
    - Executing Macros with Variations
  - Customizing Key Bindings
    - Keymaps
    - Prefix Keymaps
    - Local Keymaps
    - Minibuffer Keymaps
    - Changing Key Bindings Interactively
    - Rebinding Keys in Your Init File
    - Rebinding Function Keys
    - Named ASCII Control Characters
    - Non-ASCII Characters on the Keyboard
    - Rebinding Mouse Buttons
    - Disabling Commands
  - Keyboard Translations
  - The Syntax Table
  - The Init File, ``~/.emacs'`
    - Init File Syntax
    - Init File Examples
    - Terminal-specific Initialization
    - How Emacs Finds Your Init File
- Dealing with Common Problems
  - Quitting and Aborting
  - Dealing with Emacs Trouble
    - If `DEL` Fails to Delete
    - Recursive Editing Levels
    - Garbage on the Screen
    - Garbage in the Text
    - Spontaneous Entry to Incremental Search
    - Running out of Memory
    - Recovery After a Crash
    - Emergency Escape
    - Help for Total Frustration
  - Reporting Bugs
    - When Is There a Bug
    - Understanding Bug Reporting
    - Checklist for Bug Reports
    - Sending Patches for GNU Emacs
  - Contributing to Emacs Development
  - How To Get Help with GNU Emacs
- Command Line Arguments
  - Action Arguments
  - Initial Options
  - Command Argument Example
  - Resuming Emacs with Arguments
  - Environment Variables
    - General Variables
    - Miscellaneous Variables
  - Specifying the Display Name
  - Font Specification Options
  - Window Color Options
  - Options for Window Geometry
  - Internal and External Borders
  - Frame Titles
  - Icons
  - X Resources
  - Lucid Menu X Resources
  - Motif Menu X Resources
- Emacs 19 Antinews
- Emacs and MS-DOS
  - Keyboard and Mouse on MS-DOS
  - Display on MS-DOS
  - File Names on MS-DOS
  - Text Files and Binary Files
  - Printing and MS-DOS
  - International Support on MS-DOS
  - Subprocesses on MS-DOS
  - Subprocesses on Windows 95 and NT
  - Using the System Menu on Windows
- The GNU Manifesto
  - What's GNU? Gnu's Not Unix!
  - Why I Must Write GNU
  - Why GNU Will Be Compatible with Unix
  - How GNU Will Be Available
  - Why Many Other Programmers Want to Help
  - How You Can Contribute
  - Why All Computer Users Will Benefit
  - Some Easily Rebutted Objections to GNU's Goals
- Glossary
- Key (Character) Index
- Command and Function Index
- Variable Index
- Concept Index

This document was generated on 1 October 2001 using the texi2html translator version 1.54.