Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Learning GNU Emacs, 3rd Edition
Preface
Why Read This Book?
Which Emacs Is Which?
What's New in This Edition?
GNU Emacs and the Free Software Foundation
An Approach to Learning Emacs
What We Haven't Included
The Meta Key
Conventions Used in This Book
Keystroke Notation
Command Tables
Examples
Font Usage
How to Contact Us
Acknowledgments
1. Emacs Basics
1.1. Introducing Emacs!
1.2. Understanding Files and Buffers
1.3. A Word About Modes
1.4. Starting Emacs
1.5. About the Emacs Display
1.5.1. The Toolbar
1.5.2. The Menus
1.5.3. The Mode Line
1.5.4. The Minibuffer
1.6. Emacs Commands
1.7. Opening a File
1.7.1. If You Read the Wrong File
1.7.2. Letting Emacs Fill in the Blanks
1.7.3. Inserting and Appending Files
1.7.4. How Emacs Chooses a Default Directory
1.8. Saving Files
1.9. Leaving Emacs
1.10. Getting Help
1.10.1. The Help Menu
1.11. Summary
1.11.1. Problems You May Encounter
2. Editing
2.1. Moving the Cursor
2.1.1. Other Ways to Move the Cursor
2.1.2. Moving a Screen (or More) at a Time
2.1.3. Repeating Commands
2.1.4. Centering the Display
2.1.5. Emacs Commands and Your Keyboard
2.2. Deleting Text
2.2.1. The Kill Ring
2.3. Marking Text to Delete, Move, or Copy
2.3.1. Copying Text
2.3.2. Recovering Earlier Deletions
2.3.3. Selecting and Pasting
2.4. Emacs and the Clipboard
2.4.1. Placing Text on the Clipboard
2.4.2. Retrieving Text from the Clipboard
2.5. Editing Tricks and Shortcuts
2.5.1. Fixing Transpositions
2.5.2. Changing Capitalization
2.5.3. Overwrite Mode
2.6. Canceling Commands and Undoing Changes
2.6.1. Canceling Commands
2.6.2. Undoing Changes
2.6.3. Reverting a Buffer from a File
2.6.4. Going Back to a Previous Version: Backup Files
2.6.5. Recovering Lost Changes
2.7. Making Emacs Work the Way You Want
2.7.1. Hiding the Toolbar
2.7.2. Turning On CUA Mode for C-x, C-c, and C-v to Cut, Copy, and Paste
2.7.3. Turning On Text Mode and Auto-Fill Mode Automatically
2.7.4. Remapping Keys
2.7.5. Problems You May Encounter
3. Search and Replace
3.1. Different Kinds of Searches
3.1.1. Incremental Search
3.1.2. Simple Searches
3.1.3. Word Search
3.2. Search and Replace
3.2.1. Simple Search and Replace Operations
3.2.2. Query-Replace
3.2.3. Repeating Query-Replaces (and Other Complex Commands)
3.2.4. Recursive Editing
3.2.5. Are Emacs Searches Case-Sensitive?
3.2.6. Regular Expressions for Search and Replacement Operations
3.3. Checking Spelling Using Ispell
3.3.1. Checking a Buffer
3.3.2. Checking a Single Word
3.3.3. Completing a Word
3.3.4. Spellchecking on the Fly with Flyspell
3.4. Word Abbreviations
3.4.1. Dynamic Abbreviations
3.4.2. Word Abbreviation Mode
3.4.2.1. Trying word abbreviations for one session
3.4.2.2. Making word abbreviations part of your startup
3.4.2.3. Deleting a word abbreviation
3.4.2.4. Disabling word abbreviations
3.4.2.5. Abbreviations and capitalization
3.4.3. Problems You May Encounter
4. Using Buffers, Windows, and Frames
4.1. Understanding Buffers, Windows, and Frames
4.1.1. Windows Versus Frames
4.1.2. Buffers: Independent of Windows and Frames
4.1.3. More About Buffers
4.2. Working with Multiple Buffers
4.2.1. Switching Buffers
4.2.2. Deleting Buffers
4.3. Working with Windows
4.3.1. Creating Horizontal Windows
4.3.2. Moving Between Windows
4.3.3. Getting Rid of Windows
4.4. Working with Frames
4.4.1. Creating a New Frame
4.4.2. Moving Between Frames
4.4.3. Deleting and Minimizing Frames
4.5. More About Buffers
4.5.1. Saving Multiple Buffers
4.5.2. Renaming Buffers
4.5.3. Read-Only Buffers
4.5.4. Getting a List of Buffers
4.5.5. Working with the Buffer List
4.6. More About Windows
4.6.1. Creating Vertical or Side-by-Side Windows
4.6.2. Navigating Windows
4.6.3. Enlarging and Shrinking Windows
4.6.4. Limits on Window Size
4.6.5. Comparing Files Between Windows
4.7. Holding Your Place with Bookmarks
4.7.1. Setting Bookmarks
4.7.2. Moving to a Bookmark
4.7.3. Renaming and Deleting Bookmarks
4.7.4. Working with a List of Bookmarks
4.7.5. Annotating Bookmarks
4.7.6. A Few More Bookmark Commands
5. Emacs as a Work Environment
5.1. Executing Commands in Shell Buffers
5.1.1. Running One Command at a Time
5.1.2. Using Shell Mode
5.1.2.1. Which shell?
5.1.2.2. Making passwords invisible in shell mode
5.2. Using Dired, the Directory Editor
5.2.1. Viewing and Editing Files
5.2.2. Deleting, Copying, and Renaming Files
5.2.3. Compressing and Uncompressing Files
5.2.4. Comparing Files
5.2.5. Running Shell Commands on Files
5.2.6. Working with Groups of Files
5.2.6.1. Selecting files
5.2.6.2. Selecting likely candidates for deletion
5.2.6.3. Selecting files by type
5.2.6.4. Using regular expressions to choose files
5.2.6.5. Operating on groups of files
5.2.7. Navigating Directories
5.3. Printing from Emacs
5.4. Reading Manpages in Emacs
5.5. Using Time Management Tools
5.5.1. Displaying the Calendar
5.5.1.1. Moving in the calendar
5.5.1.2. Displaying holidays
5.5.2. Using the Diary
5.5.2.1. Creating a diary file
5.5.2.2. Adding diary entries
5.5.2.3. Displaying diary entries
5.5.3. Problems You May Encounter
6. Writing Macros
6.1. Defining a Macro
6.2. Tips for Creating Good Macros
6.3. A More Complicated Macro Example
6.4. Editing a Macro
6.5. The Macro Ring
6.6. Binding Your Macro to a Key
6.7. Naming, Saving, and Executing Your Macros
6.8. Building More Complicated Macros
6.8.1. Pausing a Macro for Keyboard Input
6.8.1.1. Example
6.8.2. Adding a Query to a Macro
6.8.2.1. Example
6.9. Executing Macros on a Region
6.10. Beyond Macros
7. Simple Text Formatting and Specialized Editing
7.1. Using Tabs
7.1.1. How Emacs 21 Handles Tabs by Default
7.1.2. Changing Tab Stops
7.1.3. What if You Want Literal Tabs?
7.1.4. Changing Tab Width
7.1.5. Tabs and Spaces
7.1.6. Changing Tabs to Spaces (and Vice Versa)
7.2. Indenting Text
7.2.1. Indenting Paragraphs
7.2.2. Indenting the First Line of a Paragraph
7.2.3. Filling Indented Paragraphs
7.2.3.1. Indenting regions
7.2.3.2. Other indentation tricks
7.2.4. Changing Margins
7.2.5. Using Fill Prefixes
7.3. Centering Text
7.4. Using Outline Mode
7.4.1. Entering Outline Mode
7.4.2. Hiding and Showing Text
7.4.3. Editing While Text Is Hidden
7.4.4. Marking Sections of the Outline
7.4.5. Promoting and Demoting Sections
7.4.6. Using Outline Minor Mode
7.5. Rectangle Editing
7.5.1. CUA Rectangle Editing
7.6. Making Simple Drawings
7.6.1. Drawing in Picture Mode
7.6.2. Editing in Picture Mode
7.6.2.1. Cursor motion in picture mode
7.6.2.2. Inserting blank lines
7.6.3. Drawing with the Mouse Using Artist
7.6.4. Problems You May Encounter
8. Markup Language Support
8.1. Comments
8.2. Font-Lock Mode
8.3. Writing HTML
8.3.1. Using HTML Mode
8.3.1.1. Character encoding in HTML mode
8.3.1.1.1. Using ISO accents mode
8.3.1.1.2. Using the C-x 8 prefix
8.3.2. Using HTML Helper Mode
8.3.2.1. Starting HTML helper mode
8.3.2.2. A brief tour of HTML helper mode
8.3.2.3. Inserting an HTML template
8.3.2.4. Putting tags around a region
8.3.2.5. Using completion
8.3.2.6. Turning on prompting
8.3.2.7. Character encoding in HTML helper mode
8.4. Writing XML
8.4.1. Writing XML with SGML Mode
8.4.2. TEI Emacs: XML Authoring for Linux and Windows
8.4.3. Writing XHTML Using nxml Mode
8.4.4. Using psgml Mode
8.5. Marking up Text for TEX and LATEX
8.5.1. Matching Braces
8.5.2. Quotation Marks and Paragraphing
8.5.3. Command Pairs
8.5.4. Processing and Printing Text
9. Computer Language Support
9.1. Emacs as an IDE
9.1.1. Compiling and Debugging
9.2. Writing Code
9.2.1. Language Modes
9.2.1.1. Syntax
9.2.2. Comments
9.2.3. Indenting Code
9.2.4. etags
9.2.5. Fonts and Font-lock Mode
9.3. C and C++ Support
9.3.1. Motion Commands
9.3.2. Customizing Code Indentation Style
9.3.3. Additional C and C++ Mode Features
9.3.4. C++ Mode Differences
9.4. Java Support
9.4.1. Java Mode
9.5. The Java Development Environment for Emacs (JDEE)
9.5.1. Getting Started
9.5.2. Installing CEDET
9.5.3. Installing the ELisp Library
9.5.4. Installing the JDEE
9.5.5. Registering Your Java Tools
9.5.5.1. JDK tools.jar problems
9.5.6. Editing with the JDEE
9.5.7. Compiling and Running with the JDEE
9.5.8. Debugging with the JDEE
9.5.9. Learning More about the JDEE
9.6. Perl Support
9.6.1. Perl Caveats
9.7. SQL Support
9.7.1. Prerequisites
9.7.2. Modes of Operation
9.7.2.1. Interactive mode
9.7.2.2. Editing mode
9.8. The Lisp Modes
9.8.1. Indentation in Lisp Modes
9.8.2. Comments in Lisp Modes
9.8.3. Emacs Lisp Mode Differences
9.8.4. Lisp Mode Differences
9.8.5. Working with Lisp Fragments
9.8.5.1. Commands for evaluating a line of Lisp
9.8.5.2. Using Lisp interaction mode
10. Customizing Emacs
10.1. Using Custom
10.1.1. Navigating Custom
10.1.2. Common Options
10.1.3. Customizing with Custom
10.1.4. An Abbrev Mode Example
10.1.5. The Options Menu
10.1.6. A Dired Example
10.1.7. But Where Is the Variable I Want?
10.2. Modifying the .emacs File Directly
10.2.1. Custom Versus .emacs
10.2.1.1. Will the real .emacs please stand up?
10.2.2. Basic .emacs Statements
10.2.2.1. Caveat editor
10.2.3. A Sample .emacs File
10.2.3.1. Editing .emacs
10.2.3.2. Saving .emacs
10.3. Modifying Fonts and Colors
10.3.1. Changing Fonts Interactively
10.3.2. Automatic Highlighting and Coloring
10.3.2.1. Isearch
10.3.2.2. Buffer highlighting
10.3.3. Customizing Fonts Through Custom
10.3.4. Changing Colors
10.3.4.1. Changing the cursor color
10.3.5. Saving Font- and Color-Enriched Text
10.3.5.1. Saving enriched text
10.4. Customizing Your Key Bindings
10.4.1. Special Keys
10.4.2. Unsetting Key Bindings
10.5. Setting Emacs Variables
10.6. Finding Emacs Lisp Packages
10.7. Starting Modes via Auto-Mode Customization
10.8. Making Emacs Work the Way You Think It Should
11. Emacs Lisp Programming
11.1. Introduction to Lisp
11.1.1. Basic Lisp Entities
11.1.2. Defining Functions
11.1.3. Turning Lisp Functions into Emacs Commands
11.2. Lisp Primitive Functions
11.2.1. Statement Blocks
11.2.2. Control Structures
11.3. Useful Built-in Emacs Functions
11.3.1. Buffers, Text, and Regions
11.3.2. Regular Expressions
11.3.2.1. Basic operators
11.3.2.2. Grouping and alternation
11.3.2.3. Context
11.3.2.4. Retrieving portions of matches
11.3.2.5. Regular expression operator summary
11.3.3. A Treasure Trove of Examples
11.3.4. Functions That Use Regular Expressions
11.3.5. Finding Other Built-in Functions
11.4. Building an Automatic Template System
11.5. Programming a Major Mode
11.5.1. Components of a Major Mode
11.5.2. More Lisp Basics: Lists
11.5.3. The Calculator Mode
11.5.4. Lisp Code for the Calculator Mode
11.6. Customizing Existing Modes
11.7. Building Your Own Lisp Library
11.7.1. Byte-Compiling Lisp Files
12. Version Control
12.1. The Uses of Version Control
12.2. Version Control Concepts
12.3. How VC Helps with Basic Operations
12.4. Editing Comment Buffers
12.5. VC Command Summary
12.6. VC Mode Indicators
12.7. Which Version Control System?
12.8. Individual VC Commands
12.8.1. Working with Groups and Subtrees of Files
12.8.2. Difference Reports
12.8.3. Retrieving Old Revisions
12.8.4. Viewing Change Histories
12.8.5. Registering a File
12.8.6. Inserting Version Control Headers
12.8.7. Making and Retrieving Snapshots
12.8.8. Updating ChangeLog Files
12.8.9. Renaming Version-Controlled Files
12.8.10. When VC Gets Confused
12.9. Customizing VC
12.10. Extending VC
12.11. What VC Is Not
12.12. Using VC Effectively
12.13. Comparing with Ediff
12.13.1. Starting Ediff
12.13.2. Using Ediff
12.13.3. Making Changes
12.13.4. Quitting Ediff
12.13.5. Recovering from Confusion
12.13.6. Learning More
12.13.7. Customizing Ediff
12.13.8. Invoking Ediff Automatically
13. Platform-Specific Considerations
13.1. Emacs and Unix
13.1.1. Where to Get Emacs?
13.1.1.1. Downloading Emacs from the Web
13.1.2. Where to Put Emacs?
13.1.3. Uncompressing and Unpacking
13.1.4. Downloading Emacs from CVS
13.1.5. Building Emacs
13.2. Emacs and Mac OS X
13.2.1. "But I Already Have Emacs"
13.2.2. Installing Prebuilt Emacs on Mac OS X
13.2.2.1. Downloading Alex Rice's application bundle of Emacs 21.3.5
13.2.3. Building Emacs from Source on Mac OS X
13.2.3.1. Before you build
13.2.3.1.1. Jaguar (Mac OS X 10.2) preparation
13.2.4. Starting Emacs from the Command Line on Mac OS X
13.2.5. Mac OS X and the Meta Key
13.2.6. Installing Ispell
13.3. Emacs and Windows
13.3.1. Installing Emacs
13.3.1.1. Installing the latest binaries: Nqmacs
13.3.1.2. Installing Emacs from the FSF
13.3.2. Where to Put Your .emacs File
13.3.3. Starting Emacs from the Command Line
13.3.4. Making Emacs Act like Windows: CUA Mode
13.3.5. Installing Ispell
14. The Help System
14.1. Using the Tutorial
14.2. Help Commands
14.2.1. Detail Information
14.2.2. Apropos Commands
14.3. Help with Complex Emacs Commands
14.4. Navigating Emacs Documentation
14.4.1. Using Info to Read Manuals
14.4.2. FAQ, News, and Antinews
14.5. Completion
14.5.1. Customizing Completion
A. Emacs Variables
B. Emacs Lisp Packages
C. Bugs and Bug Fixes
D. Online Resources
E. Quick Reference
Colophon
← Prev
Back
Next →
← Prev
Back
Next →