The Emacs Editor
Emacs is the advanced, extensible, customizable, self-documenting editor. This manual describes how to edit with Emacs and some of the ways to customize it; it corresponds to GNU Emacs version 30.1. If you are reading this in Emacs, type h to read a basic introduction to the Info documentation system. For information on extending Emacs, see Emacs Lisp.
Menu
- How to get the latest Emacs distribution.
- An introduction to Emacs concepts.
- The Organization of the Screen
- Kinds of User Input
- Keys
- Mouse Input
- Keys and Commands
- Touchscreen Input and Virtual Keyboards
- Entering Emacs
- Exiting Emacs
- Basic Editing Commands
- The Minibuffer
- Running Commands by Name
- Help
- The Mark and the Region
- Killing and Moving Text
- Registers
- Controlling the Display
- Searching and Replacement
- Commands for Fixing Typos
- Keyboard Macros
- File Handling
- Using Multiple Buffers
- Multiple Windows
- Frames and Graphical Displays
- International Character Set Support
- Major and Minor Modes
- Indentation
- Commands for Human Languages
- Editing Programs
- Compiling and Testing Programs
- Maintaining Large Programs
- Abbrevs
- Dired, the Directory Editor
- The Calendar and the Diary
- Sending Mail
- Reading Mail with Rmail
- Email and Usenet News with Gnus
- Host Security
- Network Security
- Document Viewing
- Running Shell Commands from Emacs
- Using Emacs as a Server
- Printing Hard Copies
- Sorting Text
- Editing Pictures
- Editing Binary Files
- Saving Emacs Sessions
- Recursive Editing Levels
- Hyperlinking and Web Navigation Features
- Games and Other Amusements
- Emacs Lisp Packages
- Customization
- Quitting and Aborting
- Dealing with Emacs Trouble
- Reporting Bugs
- Contributing to Emacs Development
- How To Get Help with GNU Emacs
- GNU GENERAL PUBLIC LICENSE
- GNU Free Documentation License
- Command Line Arguments for Emacs Invocation
- X Options and Resources
- Emacs 29 Antinews
- Emacs and macOS / GNUstep
- Emacs and Haiku
- Emacs and Android
- Emacs and Microsoft Windows/MS-DOS
- What's GNU? Gnu's Not Unix!
- Terms used in this manual.
- Major contributors to GNU Emacs.
- An item for each standard Emacs key sequence.
- An item for every command-line option.
- An item for each standard command name.
- An item for each variable documented in this manual.
- An item for concepts and other general subjects.
- Point
- The Echo Area
- The Mode Line
- The Menu Bar
- Using Emacs on Touchscreens
- Using Emacs with Virtual Keyboards
- 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
- Using the Minibuffer
- Minibuffers for File Names
- Editing in the Minibuffer
- Completion
- Minibuffer History
- Repeating Minibuffer Commands
- Entering passwords
- Yes or No Prompts
- Completion Example
- Completion Commands
- Completion Exit
- How Completion Alternatives Are Chosen
- Completion Options
- Help Summary
- Documentation for a Key
- Help by Command or Variable Name
- Apropos
- Help Mode Commands
- Keyword Search for Packages
- Help for International Language Support
- Other Help Commands
- Help Files
- Help on Active Text and Tooltips
- Setting the Mark
- Commands to Mark Textual Objects
- Operating on the Region
- The Mark Ring
- The Global Mark Ring
- Shift Selection
- Disabling Transient Mark Mode
- Deletion and Killing
- Yanking
- ``Cut and Paste'' Operations on Graphical Displays
- Accumulating Text
- Rectangles
- CUA Bindings
- Deletion
- Killing by Lines
- Other Kill Commands
- Options for Killing
- The Kill Ring
- Yanking Earlier Kills
- Appending Kills
- Using the Clipboard
- Cut and Paste with Other Window Applications
- Secondary Selection
- Saving Positions in Registers
- Saving Text in Registers
- Saving Rectangles in Registers
- Saving Window and Frame Configurations in Registers
- Keeping Numbers in Registers
- Keeping File and Buffer Names in Registers
- Keyboard Macro Registers
- Bookmarks
- Scrolling
- Recentering
- Automatic Scrolling
- Horizontal Scrolling
- Narrowing
- View Mode
- Follow Mode
- Text Faces
- RGB Triplets
- Standard Faces
- Text Scale
- Font Lock mode
- Interactive Highlighting
- Window Fringes
- Displaying Boundaries
- Useless Whitespace
- Selective Display
- Optional Mode Line Features
- How Text Is Displayed
- Displaying the Cursor
- Line Truncation
- Visual Line Mode
- Customization of Display
- Traditional Font Lock
- Parser-based Font Lock
- Incremental Search
- Nonincremental Search
- Word Search
- Symbol Search
- Regular Expression Search
- Syntax of Regular Expressions
- Backslash in Regular Expressions
- Regular Expression Example
- Lax Matching During Searching
- Replacement Commands
- Other Search-and-Loop Commands
- Tailoring Search to Your Needs
- Basics of Incremental Search
- Repeating Incremental Search
- Isearch Yanking
- Errors in Incremental Search
- Special Input for Incremental Search
- Not Exiting Incremental Search
- Searching the Minibuffer
- Unconditional Replacement
- Regexp Replacement
- Replace Commands and Lax Matches
- Query Replace
- Undo
- Transposing Text
- Case Conversion
- Checking and Correcting Spelling
- Basic Use
- The Keyboard Macro Ring
- The Keyboard Macro Counter
- Executing Macros with Variations
- Naming and Saving Keyboard Macros
- Editing a Keyboard Macro
- Stepwise Editing a Keyboard Macro
- File Names
- Visiting Files
- Saving Files
- Reverting a Buffer
- Auto Revert: Keeping buffers automatically up-to-date
- Auto-Saving: Protection Against Disasters
- File Name Aliases
- File Directories
- Comparing Files
- Diff Mode
- Copying, Naming and Renaming Files
- Miscellaneous File Operations
- Accessing Compressed Files
- File Archives
- Remote Files
- Quoted File Names
- File Name Cache
- Convenience Features for Finding Files
- Viewing Image Files
- Filesets
- Commands for Saving Files
- Backup Files
- Customizing Saving of Files
- Protection against Simultaneous Editing
- Shadowing Files
- Updating Time Stamps Automatically
- Single or Numbered Backups
- Automatic Deletion of Backups
- Copying vs. Renaming
- Auto Reverting the Buffer Menu
- Auto Reverting Dired buffers
- Auto-Save Files
- Controlling Auto-Saving
- Recovering Data from Auto-Saves
- Creating and Selecting Buffers
- Listing Existing Buffers
- Miscellaneous Buffer Operations
- Killing Buffers
- Operating on Several Buffers
- Indirect Buffers
- Convenience Features and Customization of Buffer Handling
- Making Buffer Names Unique
- Fast minibuffer selection
- Customizing Buffer Menus
- Concepts of Emacs Windows
- Splitting Windows
- Using Other Windows
- Displaying in Another Window
- Deleting and Resizing Windows
- Displaying a Buffer in a Window
- Displaying non-editable buffers.
- Convenience Features for Window Handling
- Window Tab Line
- Window Tool Bar
- How
display-bufferworks - Mouse Commands for Editing
- Mouse Commands for Words and Lines
- Following References with the Mouse
- Mouse Clicks for Menus
- Mode Line Mouse Commands
- Creating Frames
- Frame Commands
- Fonts
- Speedbar Frames
- Multiple Displays
- Frame Parameters
- Scroll Bars
- Window Dividers
- Drag and Drop
- Menu Bars
- Tool Bars
- Tab Bars
- Using Dialog Boxes
- Tooltips
- Mouse Avoidance
- Text Terminals
- Using a Mouse in Text Terminals
- Introduction to International Character Sets
- Language Environments
- Input Methods
- Selecting an Input Method
- Coding Systems
- Recognizing Coding Systems
- Specifying a File's Coding System
- Choosing Coding Systems for Output
- Specifying a Coding System for File Text
- Coding Systems for Interprocess Communication
- Coding Systems for File Names
- Coding Systems for Terminal I/O
- Fontsets
- Defining Fontsets
- Modifying Fontsets
- Undisplayable Characters
- Unibyte Editing Mode
- Charsets
- Bidirectional Editing
- Major Modes
- Minor Modes
- Choosing File Modes
- Indentation Commands
- Tab Stops
- Tabs vs. Spaces
- Convenience Features for Indentation
- Code Alignment
- Words
- Sentences
- Paragraphs
- Pages
- Quotation Marks
- Filling Text
- Case Conversion Commands
- Text Mode
- Outline Mode
- Org Mode
- TeX Mode
- SGML and HTML Modes
- Nroff Mode
- Enriched Text
- Editing Text-based Tables
- Two-Column Editing
- Auto Fill Mode
- Explicit Fill Commands
- The Fill Prefix
- Adaptive Filling
- Format of Outlines
- Outline Motion Commands
- Outline Visibility Commands
- Viewing One Outline in Multiple Views
- Folding Editing
- Org as an organizer
- Org as an authoring system
- TeX Editing Commands
- LaTeX Editing Commands
- TeX Printing Commands
- TeX Mode Miscellany
- Enriched Mode
- Hard and Soft Newlines
- Editing Format Information
- Faces in Enriched Text
- Indentation in Enriched Text
- Justification in Enriched Text
- Setting Other Text Properties
- What is a Text-based Table?
- Creating a Table
- Table Recognition
- Commands for Table Cells
- Cell Justification
- Table Rows and Columns
- Converting Between Plain Text and Tables
- Table Miscellany
- Major Modes for Programming Languages
- Top-Level Definitions, or Defuns
- Indentation for Programs
- Commands for Editing with Parentheses
- Manipulating Comments
- Documentation Lookup
- Hideshow minor mode
- Completion for Symbol Names
- MixedCase Words
- Semantic
- Other Features Useful for Editing Programs
- C and Related Modes
- Asm Mode
- Fortran Mode
- Left Margin Convention
- Moving by Defuns
- Imenu
- Which Function Mode
- Basic Program Indentation Commands
- Indenting Several Lines
- Customizing Lisp Indentation
- Commands for C Indentation
- Customizing C Indentation
- Expressions with Balanced Parentheses
- Moving in the Parenthesis Structure
- Matching Parentheses
- Comment Commands
- Multiple Lines of Comments
- Options Controlling Comments
- Info Documentation Lookup
- Man Page Lookup
- Programming Language Documentation Lookup
- C Mode Motion Commands
- Electric C Characters
- Hungry Delete Feature in C
- Other Commands for C Mode
- Motion Commands
- Fortran Indentation
- Fortran Comments
- Auto Fill in Fortran Mode
- Checking Columns in Fortran
- Fortran Keyword Abbrevs
- Fortran Indentation and Filling Commands
- Continuation Lines
- Line Numbers
- Syntactic Conventions
- Variables for Fortran Indentation
- Running Compilations under Emacs
- Compilation Mode
- Subshells for Compilation
- Searching with Grep under Emacs
- Finding Syntax Errors On The Fly
- Running Debuggers Under Emacs
- Executing Lisp Expressions
- Libraries of Lisp Code for Emacs
- Evaluating Emacs Lisp Expressions
- Lisp Interaction Buffers
- Running an External Lisp
- Starting GUD
- Debugger Operation
- Commands of GUD
- GUD Customization
- GDB Graphical Interface
- GDB User Interface Layout
- Source Buffers
- Breakpoints Buffer
- Threads Buffer
- Stack Buffer
- Other GDB Buffers
- Watch Expressions
- Multithreaded Debugging
- Version Control
- Working with Projects
- Change Logs
- Find Identifier References
- Emacs Development Environment
- Merging Files with Emerge
- Bug Reference
- Introduction to Version Control
- Version Control and the Mode Line
- Basic Editing under Version Control
- Features of the Log Entry Buffer
- Registering a File for Version Control
- Examining And Comparing Old Revisions
- VC Change Log
- Undoing Version Control Actions
- Ignore Version Control Files
- VC Directory Mode
- Version Control Branches
- Miscellaneous Commands and Features of VC
- Customizing VC
- Understanding the Problems it Addresses
- Supported Version Control Systems
- Concepts of Version Control
- Merge-based vs Lock-based Version Control
- Changeset-based vs File-based Version Control
- Decentralized vs Centralized Repositories
- Types of Log File
- Basic Version Control with Merging
- Basic Version Control with Locking
- Advanced Control in
C-x v v - The VC Directory Buffer
- VC Directory Commands
- Switching between Branches
- Pulling/Pushing Changes into/from a Branch
- Merging Branches
- Creating New Branches
- Change Logs and VC
- Deleting and Renaming Version-Controlled Files
- Revision Tags
- Inserting Version Control Headers
- Editing VC Commands
- General Options
- Options for RCS and SCCS
- Options specific for CVS
- Project Commands That Operate on Files
- Project Commands That Operate on Buffers
- Switching Projects
- Managing the Project List File
- Change Log Commands
- Format of ChangeLog
- Find Identifiers
- Tags Tables
- Selecting a Tags Table
- Looking Up Identifiers
- Commands Available in the
*xref*Buffer - Searching and Replacing with Identifiers
- Identifier Inquiries
- Source File Tag Syntax
- Creating Tags Tables
- Etags Regexps
- Overview of Emerge
- Submodes of Emerge
- State of a Difference
- Merge Commands
- Exiting Emerge
- Combining the Two Versions
- Fine Points of Emerge
- Abbrev Concepts
- Defining Abbrevs
- Controlling Abbrev Expansion
- Abbrevs Suggestions
- Examining and Editing Abbrevs
- Saving Abbrevs
- Dynamic Abbrev Expansion
- Customizing Dynamic Abbreviation
- Basic Editing in Picture Mode
- Controlling Motion after Insert
- Picture Mode Tabs
- Picture Mode Rectangle Commands
- Entering Dired
- Navigation 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
- Subdirectory Switches in Dired
- Moving Over Subdirectories
- Hiding Subdirectories
- Updating the Dired Buffer
- Dired and
find - Editing the Dired Buffer
- Viewing Image Thumbnails in Dired
- Other Dired Features
- Movement in the Calendar
- Scrolling in the Calendar
- Counting Days
- Miscellaneous Calendar Commands
- Writing Calendar Files
- Holidays
- Times of Sunrise and Sunset
- Phases of the Moon
- Conversion To and From Other Calendars
- The Diary
- Daylight Saving Time
- Summing Time Intervals
- More advanced features of the Calendar and Diary
- Motion by Standard Lengths of Time
- Beginning or End of Week, Month or Year
- Specified Dates
- Supported Calendar Systems
- Converting To Other Calendars
- Converting From Other Calendars
- The Diary File
- Displaying the Diary
- Date Formats
- Commands to Add to the Diary
- Special Diary Entries
- Appointments
- Importing and Exporting Diary Entries
- Customizing the Calendar
- Customizing the Holidays
- Converting from the Mayan Calendar
- Date Display Format
- Time Display Format
- Customizing the Diary
- Diary Entries Using non-Gregorian Calendars
- Diary Display
- Fancy Diary Display
- Sexp Entries and the Fancy Diary Display
- The Format of the Mail Buffer
- Mail Header Fields
- Mail Aliases
- Mail Commands
- Mail Signature
- Mail Amusements
- Mail-Composition Methods
- Mail Sending
- Mail Header Editing
- Citing Mail
- Mail Miscellany
- 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
- Sorting the Rmail File
- Display of Messages
- Rmail and Coding Systems
- Editing Within a Message
- Digest Messages
- Reading Rot13 Messages
movemailprogram- Retrieving Mail from Remote Mailboxes
- Retrieving Mail from Local Mailboxes in Various Formats
- Making Summaries
- Editing in Summaries
- Gnus Buffers
- When Gnus Starts Up
- Using the Gnus Group Buffer
- Using the Gnus Summary Buffer
- DocView Navigation
- DocView Searching
- DocView Slicing
- DocView Conversion
- Single Shell Commands
- Interactive Subshell
- Shell Mode
- Shell Prompts
- Shell Command History
- Directory Tracking
- Shell Mode Options
- Emacs Terminal Emulator
- Term Mode
- Remote Host Shell
- Serial Terminal
- Shell History Ring
- Shell History Copying
- Shell History References
- TCP Emacs server
- Invoking
emacsclient emacsclientOptions- PostScript Hardcopy
- Variables for PostScript Hardcopy
- Printing Package
- Web Browsing with EWW
- Embedded WebKit Widgets
- Following URLs
- Activating URLs
- Finding Files and URLs at Point
- The Package Menu Buffer
- Package Statuses
- Package Installation
- Package Files and Directory Layout
- Easy Customization Interface
- Variables
- Customizing Key Bindings
- The Emacs Initialization File
- Keeping Persistent Authentication Information
- Customization Groups
- Browsing and Searching for Settings
- Changing a Variable
- Saving Customizations
- Customizing Faces
- Customizing Specific Items
- Custom Themes
- Creating Custom Themes
- Examining and Setting Variables
- Hooks
- Local Variables
- Local Variables in Files
- Per-Directory Local Variables
- Per-Connection Local Variables
- Specifying File Variables
- Safety of File Variables
- Per-Directory Variables via EditorConfig
- Keymaps
- Prefix Keymaps
- Local Keymaps
- Minibuffer Keymaps
- Changing Key Bindings Interactively
- Rebinding Keys in Your Init File
- Modifier Keys
- Rebinding Function Keys
- Named ASCII Control Characters
- Rebinding Mouse Buttons
- Disabling Commands
- Init File Syntax
- Init File Examples
- Terminal-specific Initialization
- How Emacs Finds Your Init File
- Non-ASCII Characters in Init Files
- The Early Init File
- Recursive Editing Levels
- Garbage on the Screen
- Garbage in the Text
- Running out of Memory
- When Emacs Crashes
- Recovery After a Crash
- Emergency Escape
- If
DELFails to Delete - Reading Existing Bug Reports and Known Problems
- When Is There a Bug
- Understanding Bug Reporting
- Checklist for Bug Reports
- Sending Patches for GNU Emacs
- Coding Standards
- Copyright Assignment
- Action Arguments
- Initial Options
- Command Argument Example
- Environment Variables
- Specifying the Display Name
- Font Specification Options
- Window Color Options
- Options for Window Size and Position
- Internal and Outer Borders
- Frame Titles
- Icons
- Other Display Options
- General Variables
- Miscellaneous Variables
- The MS-Windows System Registry
- X Resources
- Table of X Resources for Emacs
- Lucid Menu And Dialog X Resources
- Motif Menu X Resources
- GTK+ resources
- GTK+ Resource Basics
- GTK+ widget names
- GTK+ Widget Names in Emacs
- GTK+ styles
- Grabbing environment variables
- macOS Trackpad/Mousewheel Variables
- Windowing System Events under macOS / GNUstep
- GNUstep Support
- Haiku Installation and Startup
- Font Backends and Selection under Haiku
- Android History
- Starting Emacs on Android
- What Files Emacs Can Access on Android
- Accessing Files from Other Programs on Android
- Running Emacs under Android
- The Android Window System
- Font Backends and Selection under Android
- Troubleshooting Startup Problems on Android
- Installing Extra Software on Android
- How to Start Emacs on MS-Windows
- Text Files and Binary Files
- File Names on MS-Windows
- Emulation of
lson MS-Windows - HOME and Startup Directories on MS-Windows
- Keyboard Usage on MS-Windows
- Mouse Usage on MS-Windows
- Subprocesses on Windows 9X/ME and Windows NT/2K/XP/Vista/7/8/10
- Printing and MS-Windows
- Specifying Fonts on MS-Windows
- Miscellaneous Windows-specific features
- Emacs and MS-DOS
- Keyboard Usage on MS-DOS
- Mouse Usage on MS-DOS
- Display on MS-DOS
- File Names on MS-DOS
- Printing and MS-DOS
- International Support on MS-DOS
- Subprocesses on MS-DOS