Go to the next chapter.
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, but not how to
extend it. It corresponds to GNU Emacs version 19.29.
- Distrib: How to get the latest Emacs distribution.
- Copying: The GNU General Public License gives you
permission to redistribute GNU Emacs on certain terms; it also explains that there is no
- Intro: An introduction to Emacs concepts.
- Glossary: The glossary.
- Antinews: Information about Emacs version 19.28.
- MS-DOS: Using Emacs on MS-DOS (otherwise known as
- Manifesto: What's GNU? Gnu's Not Unix!
- Acknowledgments: Major contributors to GNU Emacs.
nodes containing large menus
- Key Index: An item for each standard Emacs key
- Command Index: An item for each command name.
- Variable Index: An item for each documented variable.
- Concept Index: An item for each concept.
- Screen: How to interpret what you see on the screen.
- User Input: Kinds of input events (characters, buttons,
- Keys: Key sequences: what you type to request one
- Commands: Named functions run by key sequences to do
- Text Characters: Character set for text (the contents of
buffers and strings).
- Entering Emacs: Starting Emacs from the shell.
- Exiting: Stopping or killing Emacs.
- Command Arguments: Hairy startup options.
- Basic: The most basic editing commands.
- Minibuffer: Entering arguments that are prompted for.
- M-x: Invoking commands by their names.
- Help: Commands for asking Emacs about its commands.
- Mark: The mark: how to delimit a ``region'' of text.
- Killing: Killing text.
- Yanking: Recovering killed text. Moving text.
- Accumulating Text: Other ways of copying text.
- Rectangles: Operating on the text inside a rectangle on
- Registers: Saving a text string or a location in the
- Display: Controlling what text is displayed.
- Search: Finding or replacing occurrences of a string.
- Fixit: Commands especially useful for fixing typos.
Units of Text
- Files: All about handling files.
- Buffers: Multiple buffers; editing several files at
- Windows: Viewing two pieces of text at once.
- Frames: Running the same Emacs session in multiple X
- Major Modes: Text mode vs. Lisp mode vs. C mode ...
- Indentation: Editing the white space at the beginnings
- Text: Commands and modes for editing English.
- Programs: Commands and modes for editing programs.
- Building: Compiling, running and debugging programs.
- Abbrevs: How to define text abbreviations to reduce
the number of characters you must type.
- Picture: Editing pictures made up of characters using
the quarter-plane screen model.
- Sending Mail: Sending mail in Emacs.
- Rmail: Reading mail in Emacs.
- Dired: You can ``edit'' a directory to manage files in
- Calendar/Diary: The calendar and diary facilities.
- GNUS: How to read netnews with Emacs.
- Shell: Executing shell commands from Emacs.
- Emacs Server: Using Emacs as an editing server for
- Hardcopy: Printing buffers or regions.
- Postscript: Printing buffers or regions as Postscript.
- Sorting: Sorting lines, paragraphs or pages within
- Narrowing: Restricting display and editing to a
portion of the buffer.
- Two-Column: Splitting apart columns to edit them in
- Editing Binary Files: Using Hexl mode to edit binary
- Saving Emacs Sessions: Saving Emacs state from one
session to the next.
- Recursive Edit: A command can allow you to do editing
"within the command". This is called a `recursive editing level'.
- Emulation: Emulating some other editors with Emacs.
- Dissociated Press: Dissociating text for fun.
- Amusements: Various games and hacks.
- Customization: Modifying the behavior of Emacs.
- Quitting: Quitting and aborting.
- Lossage: What to do if Emacs is hung or
- Bugs: How and when to report a bug.
- Service: How to get help for your own Emacs needs.
are some other nodes which are really inferiors of the ones already listed, mentioned here
so you can get to them in one step:
--- The Detailed Node Listing ---
The Organization of the Screen
- Point: The place in the text where editing commands
- Echo Area: Short messages appear at the bottom of the
- Mode Line: Interpreting the mode line.
- Inserting Text: Inserting text by simply typing it.
- Moving Point: How to move the cursor to the place where
you want to change something.
- Erasing: Deleting and killing text.
- Undo: Undoing recently made changes in the text.
- Files: Visiting, creating, and saving files.
- Help: Asking what a character does.
- Blank Lines: Commands to make or delete blank lines.
- Continuation Lines: Lines too wide for the screen.
- Position Info: What page, line, row, or column is point
- Arguments: Numeric arguments for repeating a command.
- Minibuffer File: Entering file names with the
- Minibuffer Edit: How to edit in the minibuffer.
- Completion: An abbreviation facility for minibuffer
- Minibuffer History: Reusing recent minibuffer arguments.
- Repetition: Re-executing commands that used the
- Help Summary: Brief list of all Help commands.
- Key Help: Asking what a key does in Emacs.
- Name Help: Asking about a command, variable or function
- Apropos: Asking what pertains to a given topic.
- Library Keywords: Finding Lisp libraries by keywords
- Misc Help: Other help commands.
The Mark and the
- Setting Mark: Commands to set the mark.
- Transient Mark: How to make Emacs highlight the
region-- when there is one.
- Using Region: Summary of ways to operate on contents of
- Marking Objects: Commands to put region around textual
- Mark Ring: Previous mark positions saved so you can go
- Global Mark Ring: Previous mark positions in various
Deletion and Killing
- Deletion: Commands for deleting small amounts of text
and blank areas.
- Killing by Lines: How to kill entire lines of text at
- Other Kill Commands: Commands to kill large regions of
text and syntactic units such as words and sentences.
- Kill Ring: Where killed text is stored. Basic yanking.
- Appending Kills: Several kills in a row all yank
- Earlier Kills: Yanking something killed some time ago.
- RegPos: Saving positions in registers.
- RegText: Saving text in registers.
- RegRect: Saving rectangles in registers.
- RegConfig: Saving window configurations in registers.
- RegFiles: File names in registers.
- Bookmarks: Bookmarks are like registers, but
Controlling the Display
- Scrolling: Moving text up and down in a window.
- Horizontal Scrolling: Moving text left and right in a
- Selective Display: Hiding lines with lots of
- Optional Mode Line: Optional mode line features.
- European Display: Displaying (and entering) European
- Display Vars: Information on variables for customizing
Searching and Replacement
- Incremental Search: Search happens as you type the
- Nonincremental Search: Specify entire string and then
- Word Search: Search for sequence of words.
- Regexp Search: Search for match for a regexp.
- Regexps: Syntax of regular expressions.
- Search Case: To ignore case while searching, or not.
- Replace: Search, and replace some or all matches.
- Other Repeating Search: Operating on all matches for
- Unconditional Replace: Replacing all matches for a
- Regexp Replace: Replacing all matches for a regexp.
- Replacement and Case: How replacements preserve case of
- Query Replace: How to use querying.
- Kill Errors: Commands to kill a batch of recently
- Transpose: Exchanging two characters, words, lines,
- Fixing Case: Correcting case of last word entered.
- Spelling: Apply spelling checker to a word, or a whole
- File Names: How to type and edit file name arguments.
- Visiting: Visiting a file prepares Emacs to edit the
- Saving: Saving makes your changes permanent.
- Reverting: Reverting cancels all the changes not
- Auto Save: Auto Save periodically protects against
loss of data.
- File Aliases: Handling multiple names for one file.
- Version Control: Version control systems (RCS and
- Directories: Listing the contents of a file directory.
- Comparing Files: Finding where two files differ.
- Misc File Ops: Other things you can do on files.
- Backup: How Emacs saves the old version of your file.
- Interlocking: How Emacs protects against simultaneous
editing of one file by two users.
- Version Systems: Supported version control back end
- VC Concepts: Basic version control information;
checking files in and out.
- Editing with VC: Commands for editing a file
maintained with version control.
- Log Entries: Logging your changes.
- Change Logs and VC: Generating a change log file from
- Old Versions: Examining and comparing old versions.
- Branches: Selecting a branch to put your changes in,
and creating a new branch.
- Status in VC: Commands to view the VC status of files
and look at log entries.
- Renaming and VC: A command to rename both the source
and master file correctly.
- Snapshots: How to make and use snapshots, a set of
file versions that can be treated as a unit.
- Version Headers: Inserting version control headers
into working files.
- Customizing VC: Variables to change VC's behavior.
- Select Buffer: Creating a new buffer or reselecting an
- List Buffers: Getting a list of buffers that exist.
- Misc Buffer: Renaming; changing read-onliness; copying
- Kill Buffer: Killing buffers you no longer need.
- Several Buffers: How to go through the list of all
buffers and operate variously on several of them.
- Indirect Buffers: An indirect buffer shares the text
of another buffer.
- Basic Window: Introduction to Emacs windows.
- Split Window: New windows are made by splitting
- Other Window: Moving to another window or doing
something to it.
- Pop Up Window: Finding a file or buffer in another
- Change Window: Deleting windows and changing their
Frames and X Windows
- Mouse Commands: Moving, cutting, and pasting, with the
- Secondary Selection: Cutting without altering point
- Mouse References: Using the mouse to select an item
from a list.
- Mode Line Mouse: Mouse clicks on the mode line.
- Creating Frames: Creating additional Emacs frames with
- Special Buffer Frames: You can make certain buffers
have their own frames.
- Frame Parameters: Changing the colors and other modes
- Scroll Bars: How to enable and disable scroll bars;
how to use them.
- Menu Bars: Enabling and disabling the menu bar.
- Faces: How to change the display style using faces.
- Modifying Faces: How to change what a particular face
- Misc X: Iconifying and deleting frames. Region
- Choosing Modes: How major modes are specified or
- Indentation Commands: Various commands and techniques
- Tab Stops: You can set arbitrary "tab stops"
and then indent to the next tab stop when you want to.
- Just Spaces: You can request indentation using just
Commands for Human Languages
- Words: Moving over and killing words.
- Sentences: Moving over and killing sentences.
- Paragraphs: Moving over paragraphs.
- Pages: Moving over pages.
- Filling: Filling or justifying text.
- Case: Changing the case of text.
- Text Mode: The major modes for editing text files.
- Outline Mode: The major mode for editing outlines.
- TeX Mode: The major modes for editing input to the
- Nroff Mode: The major mode for editing input to the
- Formatted Text: Editing formatted text directly in
- Auto Fill: Auto Fill mode breaks long lines
- Fill Commands: Commands to refill paragraphs and
- Fill Prefix: Filling when every line is indented or in
a comment, etc.
- Program Modes: Major modes for editing programs.
- Lists: Expressions with balanced parentheses.
- List Commands: The commands for working with list and
- Defuns: Each program is made up of separate functions.
There are editing commands to operate on them.
- Program Indent: Adjusting indentation to show the
- Matching: Insertion of a close-delimiter flashes
- Comments: Inserting, killing, and aligning comments.
- Balanced Editing: Inserting two matching parentheses
at once, etc.
- Symbol Completion: Completion on symbol names of your
program or language.
- Documentation: Getting documentation of functions you
plan to call.
- Change Log: Maintaining a change history for your
- Tags: Go direct to any function in your program in one
command. Tags remembers which file it is in.
- Emerge: A convenient way of merging two versions of a
- C Mode: Special commands of C mode (and C++ mode).
- Fortran: Fortran mode and its special features.
- Asm Mode: Asm mode and its special features.
- Basic Indent: Indenting a single line.
- Multi-line Indent: Commands to reindent many lines at
- Lisp Indent: Specifying how each Lisp function should
- C Indent: Choosing an indentation style for C code.
- Tag Syntax: Tag syntax for various types of code and
- Create Tags Table: Creating a tags table with
- Select Tags Table: How to visit a tags table.
- Find Tag: Commands to find the definition of a
- Tags Search: Using a tags table for searching and
- Tags Stepping: Visiting files in a tags table, one by
- List Tags: Listing and finding tags defined in a file.
Merging Files with Emerge
- Overview of Emerge: How to start Emerge. Basic
- Submodes of Emerge: Fast mode vs. Edit mode. Skip
Prefers mode and Auto Advance mode.
- State of Difference: You do the merge by specifying
state A or B for each difference.
- Merge Commands: Commands for selecting a difference,
changing states of differences, etc.
- Exiting Emerge: What to do when you've finished the
- Combining in Emerge: How to keep both alternatives for
- Fine Points of Emerge: Misc.
Compiling and Testing
- Compilation: Compiling programs in languages other
than Lisp (C, Pascal, etc.)
- Debuggers: Running symbolic debuggers for non-Lisp
- Executing Lisp: Various modes for editing Lisp
programs, with different facilities for running the Lisp programs.
- Libraries: Creating Lisp programs to run in Emacs.
- Interaction: Executing Lisp in an Emacs buffer.
- Eval: Executing a single Lisp expression in Emacs.
- External Lisp: Communicating through Emacs with a
Running Debuggers Under Emacs
- Starting GUD: How to start a debugger subprocess.
- Debugger Operation: Connection between the debugger
and source buffers.
- Commands of GUD: Key bindings for common commands.
- GUD Customization: Defining your own commands for GUD.
- Abbrev Concepts: Fundamentals of defined abbrevs.
- Defining Abbrevs: Defining an abbrev, so it will
expand when typed.
- Expanding Abbrevs: Controlling expansion: prefixes,
- Editing Abbrevs: Viewing or editing the entire list of
- Saving Abbrevs: Saving the entire list of abbrevs for
- Dynamic Abbrevs: Abbreviations for words already in
- Basic Picture: Basic concepts and simple commands of
- Insert in Picture: Controlling direction of cursor
motion after "self-inserting" characters.
- Tabs in Picture: Various features for tab stops and
- Rectangles in Picture: Clearing and superimposing
- Mail Format: Format of the mail being composed.
- Mail Headers: Details of permitted mail header fields.
- Mail Aliases: Abbreviating and grouping mail
- Mail Mode: Special commands for editing mail being
- Distracting NSA: How to distract the NSA's attention.
Mail with Rmail
- Rmail Basics: Basic concepts of Rmail, and simple use.
- Rmail Scrolling: Scrolling through a message.
- Rmail Motion: Moving to another message.
- Rmail Deletion: Deleting and expunging messages.
- Rmail Inbox: How mail gets into the Rmail file.
- Rmail Files: Using multiple Rmail files.
- Rmail Output: Copying message out to files.
- Rmail Labels: Classifying messages by labeling them.
- Rmail Reply: Sending replies to messages you are
- Rmail Summary: Summaries show brief info on many
- Rmail Sorting: Sorting messages in Rmail.
- Rmail Display: How Rmail displays a message;
- Rmail Editing: Editing message text and headers in
- Rmail Digest: Extracting the messages from a digest
- Out of Rmail: Converting an Rmail file to mailbox
- Rmail Rot13: Reading messages encoded in the rot13
Dired, the Directory Editor
- Dired Enter: How to invoke Dired.
- Dired Commands: Commands in the Dired buffer.
- Dired Deletion: Deleting files with Dired.
- Flagging Many Files: Flagging files based on their
- Dired Visiting: Other file operations through Dired.
- Marks vs Flags: Flagging for deletion vs marking.
- Operating on Files: How to copy, rename, print,
compress, etc. either one file or several files.
- Shell Commands in Dired: Running a shell command on
the marked files.
- Transforming File Names: Using patterns to rename
- Comparison in Dired: Running `diff' by way of Dired.
- Subdirectories in Dired: Adding subdirectories to the
- Subdirectory Motion: Moving across subdirectories, and
up and down.
- Hiding Subdirectories: Making subdirectories visible
- Dired Updating: Discarding lines for files of no
- Dired and Find: Using `find' to choose the files for
The Calendar and the Diary
- Calendar Motion: Moving through the calendar;
selecting a date.
- Scroll Calendar: Bringing earlier or later months onto
- Counting Days: How many days are there between two
- General Calendar: Exiting or recomputing the calendar.
- Holidays: Displaying dates of holidays.
- Sunrise/Sunset: Displaying local times of sunrise and
- Lunar Phases: Displaying phases of the moon.
- Other Calendars: Converting dates to other calendar
- Diary: Displaying events from your diary.
- Appointments: Reminders when it's time to do
- Daylight Savings: How to specify when daylight savings
time is active.
Movement in the Calendar
- Calendar Unit Motion: Moving by days, weeks, months,
- Move to Beginning or End: Moving to start/end of
weeks, months, and years.
- Specified Dates: Moving to the current date or another
Conversion To and From Other Calendars
- Calendar Systems: The calendars Emacs understands
(aside from Gregorian).
- To Other Calendar: Converting the selected date to
- From Other Calendar: Moving to a date specified in
- Mayan Calendar: Moving to a date specified in a Mayan
- Diary Commands: Viewing diary entries and associated
- Format of Diary File: Entering events in your diary.
- Date Formats: Various ways you can specify dates.
- Adding to Diary: Commands to create diary entries.
- Special Diary Entries: Anniversaries, blocks of dates,
cyclic entries, etc.
- Buffers of GNUS: The Newsgroups, Summary and Article
- GNUS Startup: What you should know about starting
- Summary of GNUS: A short description of the basic GNUS
Running Shell Commands from Emacs
- Single Shell: How to run one shell command and return.
- Interactive Shell: Permanent shell taking input via
- Shell Mode: Special Emacs commands used with permanent
- Shell History: Repeating previous commands in a shell
- Shell Options: Options for customizing Shell mode.
- Remote Host: Connecting to another computer.
- Minor Modes: Each minor mode is one feature you can
turn on independently of any others.
- Variables: Many Emacs commands examine Emacs variables
to decide what to do; by setting variables, you can control their functioning.
- Keyboard Macros: A keyboard macro records a sequence
of keystrokes to be replayed with a single command.
- Key Bindings: The keymaps say what command each key
runs. By changing them, you can "redefine keys".
- Keyboard Translations: If your keyboard passes an
undesired code for a key, you can tell Emacs to substitute another code.
- Syntax: The syntax table controls how words and
expressions are parsed.
- Init File: How to write common customizations in the .emacs
- Examining: Examining or setting one variable's value.
- Edit Options: Examining or editing list of all
- Hooks: Hook variables let you specify programs for
parts of Emacs to run on particular occasions.
- Locals: Per-buffer values of variables.
- File Variables: How files can specify variable values.
- Basic Kbd Macro: Defining and running keyboard macros.
- Save Kbd Macro: Giving keyboard macros names; saving
them in files.
- Kbd Macro Query: Keyboard macros that do different
things each use.
Customizing Key Bindings
- Keymaps: Generalities. The global keymap.
- Prefix Keymaps: Keymaps for prefix keys.
- Local Keymaps: Major and minor modes have their own
- Minibuffer Maps: The minibuffer uses its own local
- Rebinding: How to redefine one key's meaning
- Init Rebinding: Rebinding keys with your init file, .emacs.
- Function Keys: Rebinding terminal function keys.
- Named ASCII Chars: Distinguishing TAB from C-i,
and so on.
- Mouse Buttons: Rebinding mouse buttons in Emacs.
- Disabling: Disabling a command means confirmation is
required before it can be executed. This is done to protect beginners from surprises.
Init File, ~/.emacs
- Init Syntax: Syntax of constants in Emacs Lisp.
- Init Examples: How to do some things with an init
- Terminal Init: Each terminal type can have an init
- Find Init: How Emacs finds the init file.
with Emacs Trouble
- DEL Gets Help: What to do if DEL doesn't
- Stuck Recursive: `[...]' in mode line around the
- Screen Garbled: Garbage on the screen.
- Text Garbled: Garbage in the text.
- Unasked-for Search: Spontaneous entry to incremental
- Memory Full: How to cope when you run out of memory.
- Emergency Escape: Emergency escape--- What to do if
Emacs stops responding.
- Total Frustration: When you are at your wits' end.
- Criteria: Have you really found a bug?
- Understanding Bug Reporting: How to report a bug
- Checklist: Steps to follow for a good bug report.
- Sending Patches: How to send a patch for GNU Emacs.
Line Options and Arguments
- Action Arguments: Arguments to visit files, load
libraries, and call functions.
- Initial Options: Arguments that take effect while
- Command Example: Examples of using command line
- Resume Arguments: Specifying arguments when you resume
a running Emacs.
- Environment: Environment variables that Emacs uses.
- Display X: Changing the default display and using
- Font X: Choosing a font for text, under X.
- Colors X: Choosing colors, under X.
- Window Size X: Start-up window size, under X.
- Borders X: Internal and external borders, under X.
- Icons X: Choosing what sort of icon to use, under X.
- Resources X: Advanced use of classes and resources,
- Lucid Resources: X resources for Lucid menus.
- Motif Resources: X resources for Motif menus.
- General Variables: Environment variables that all
versions of Emacs use.
- Misc Variables: Certain system specific variables.
GNU Emacs is free software; this means that everyone is free to use it and
free to redistribute it on certain conditions. GNU Emacs is not in the public domain; it
is copyrighted and there are restrictions on its distribution, but these restrictions are
designed to permit everything that a good cooperating citizen would want to do. What is
not allowed is to try to prevent others from further sharing any version of GNU Emacs that
they might get from you. The precise conditions are found in the GNU General Public
License that comes with Emacs and also appears following this section.
One way to get a copy of GNU Emacs is from someone else who has it. You need not ask
for our permission to do so, or tell any one else; just copy it. If you have access to the
Internet, you can get the latest distribution version of GNU Emacs by anonymous FTP; see
the file etc/FTP in the Emacs distribution for more information.
You may also receive GNU Emacs when you buy a computer. Computer manufacturers 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 changes they may have made, and to
permit you to redistribute the GNU Emacs received from them under the usual terms of the
General Public License. In other words, the program must be free for you when you get it,
not just free for the manufacturer.
You can also order copies of GNU Emacs from the Free Software Foundation, on various
magnetic media or on CD-ROM. This is a convenient and reliable way to get a copy; it is
also a good way to help fund our work. (The Foundation has always received most of its
funds in this way.) An order form is included at the end of manuals printed by the
Foundation. It is also included in the file etc/ORDERS in the Emacs distribution.
For further information, write to
Free Software Foundation
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA
The income from distribution fees goes to support the foundation's purpose: the
development of new free software, and improvements to our existing programs including GNU
If you find GNU Emacs useful, please send a donation to the Free
Software Foundation to support our work. Donations to the Free Software Foundation are tax
deductible. If you use GNU Emacs at your workplace, suggest that the company make a
donation. If company policy is unsympathetic to the idea of donating to charity, you might
instead suggest ordering a CD-ROM from the Foundation occasionally, or subscribing to