GNU Emacs Lisp Reference Manual

GNU Emacs Version 19, for Unix Users, Second Edition, June 1993, Further Revised, August 1993

The GNU Manual Group

  1. GNU GENERAL PUBLIC LICENSE
    1. Preamble
    2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    3. How to Apply These Terms to Your New Programs
  2. Introduction
    1. Caveats
    2. Lisp History
    3. Conventions
      1. Some Terms
      2. nil and t
      3. Evaluation Notation
      4. Printing Notation
      5. Error Messages
      6. Buffer Text Notation
      7. Format of Descriptions
        1. A Sample Function Description
        2. A Sample Variable Description
    4. Acknowledgements
  3. Lisp Data Types
    1. Printed Representation and Read Syntax
    2. Comments
    3. Programming Types
      1. Integer Type
      2. Floating Point Type
      3. Character Type
      4. Sequence Types
      5. List Type
        1. Dotted Pair Notation
        2. Association List Type
      6. Array Type
      7. String Type
      8. Vector Type
      9. Symbol Type
      10. Lisp Function Type
      11. Lisp Macro Type
      12. Primitive Function Type
      13. Byte-Code Function Type
      14. Autoload Type
    4. Editing Types
      1. Buffer Type
      2. Window Type
      3. Frame Type
      4. Window Configuration Type
      5. Marker Type
      6. Process Type
      7. Stream Type
      8. Keymap Type
      9. Syntax Table Type
      10. Display Table Type
      11. Overlay Type
    5. Type Predicates
    6. Equality Predicates
  4. Numbers
    1. Integer Basics
    2. Floating Point Basics
    3. Type Predicates for Numbers
    4. Comparison of Numbers
    5. Numeric Conversions
    6. Arithmetic Operations
    7. Bitwise Operations on Integers
    8. Transcendental Functions
    9. Random Numbers
  5. Strings and Characters
    1. Introduction to Strings and Characters
    2. The Predicates for Strings
    3. Creating Strings
    4. Comparison of Characters and Strings
    5. Conversion of Characters and Strings
    6. Formatting Strings
    7. Character Case
    8. The Case Table
  6. Lists
    1. Lists and Cons Cells
    2. Lists as Linked Pairs of Boxes
    3. Predicates on Lists
    4. Accessing Elements of Lists
    5. Building Cons Cells and Lists
    6. Modifying Existing List Structure
      1. Altering List Elements with setcar
      2. Altering the CDR of a List
      3. Functions that Rearrange Lists
    7. Using Lists as Sets
    8. Association Lists
  7. Sequences, Arrays, and Vectors
    1. Sequences
    2. Arrays
    3. Functions that Operate on Arrays
    4. Vectors
  8. Symbols
    1. Symbol Components
    2. Defining Symbols
    3. Creating and Interning Symbols
    4. Property Lists
  9. Evaluation
    1. Eval
    2. Kinds of Forms
      1. Self-Evaluating Forms
      2. Symbol Forms
      3. Classification of List Forms
      4. Symbol Function Indirection
      5. Evaluation of Function Forms
      6. Lisp Macro Evaluation
      7. Special Forms
      8. Autoloading
    3. Quoting
  10. Control Structures
    1. Sequencing
    2. Conditionals
    3. Constructs for Combining Conditions
    4. Iteration
    5. Nonlocal Exits
      1. Explicit Nonlocal Exits: catch and throw
      2. Examples of catch and throw
      3. Errors
        1. How to Signal an Error
        2. How Emacs Processes Errors
        3. Writing Code to Handle Errors
        4. Error Symbols and Condition Names
      4. Cleaning Up from Nonlocal Exits
  11. Variables
    1. Global Variables
    2. Variables that Never Change
    3. Local Variables
    4. When a Variable is "Void"
    5. Defining Global Variables
    6. Accessing Variable Values
    7. How to Alter a Variable Value
    8. Scoping Rules for Variable Bindings
      1. Scope
      2. Extent
      3. Implementation of Dynamic Scoping
      4. Proper Use of Dynamic Scoping
    9. Buffer-Local Variables
      1. Introduction to Buffer-Local Variables
      2. Creating and Destroying Buffer-local Bindings
      3. The Default Value of a Buffer-Local Variable
  12. Functions
    1. What Is a Function?
    2. Lambda Expressions
      1. Components of a Lambda Expression
      2. A Simple Lambda-Expression Example
      3. Advanced Features of Argument Lists
      4. Documentation Strings of Functions
    3. Naming a Function
    4. Defining Named Functions
    5. Calling Functions
    6. Mapping Functions
    7. Anonymous Functions
    8. Accessing Function Cell Contents
    9. Inline Functions
    10. Other Topics Related to Functions
  13. Macros
    1. A Simple Example of a Macro
    2. Expansion of a Macro Call
    3. Macros and Byte Compilation
    4. Defining Macros
    5. Backquote
    6. Common Problems Using Macros
      1. Evaluating Macro Arguments Too Many Times
      2. Local Variables in Macro Expansions
      3. Evaluating Macro Arguments in Expansion
      4. How Many Times is the Macro Expanded?
  14. Loading
    1. How Programs Do Loading
    2. Autoload
    3. Repeated Loading
    4. Features
    5. Unloading
    6. Hooks for Loading
  15. Byte Compilation
    1. The Compilation Functions
    2. Evaluation During Compilation
    3. Byte-Code Objects
    4. Disassembled Byte-Code
  16. Debugging Lisp Programs
    1. The Lisp Debugger
      1. Entering the Debugger on an Error
      2. Debugging Infinite Loops
      3. Entering the Debugger on a Function Call
      4. Explicit Entry to the Debugger
      5. Using the Debugger
      6. Debugger Commands
      7. Invoking the Debugger
      8. Internals of the Debugger
    2. Debugging Invalid Lisp Syntax
      1. Excess Open Parentheses
      2. Excess Close Parentheses
    3. Debugging Problems in Compilation
    4. Edebug
      1. Using Edebug
      2. Preparing Functions for Edebug
      3. Edebug Modes
      4. Stepping
      5. Miscellaneous
      6. Breakpoints
      7. Views
      8. Evaluation
      9. Evaluation List Buffer
      10. Printing
      11. The Outside Context
        1. Just Checking
        2. Outside Window Configuration
        3. Recursive Edit
        4. Side Effects
      12. Macro Calls
      13. Edebug Options
  17. Reading and Printing Lisp Objects
    1. Introduction to Reading and Printing
    2. Input Streams
    3. Input Functions
    4. Output Streams
    5. Output Functions
    6. Variables Affecting Output
  18. Minibuffers
    1. Introduction to Minibuffers
    2. Reading Text Strings with the Minibuffer
    3. Reading Lisp Objects with the Minibuffer
    4. Minibuffer History
    5. Completion
      1. Basic Completion Functions
      2. Programmed Completion
      3. Completion and the Minibuffer
      4. Minibuffer Commands That Do Completion
      5. High-Level Completion Functions
      6. Reading File Names
      7. Lisp Symbol Completion
    6. Yes-or-No Queries
    7. Asking Multiple Y-or-N Queries
    8. Minibuffer Miscellany
  19. Command Loop
    1. Command Loop Overview
    2. Defining Commands
      1. Using interactive
      2. Code Characters for interactive
      3. Examples of Using interactive
    3. Interactive Call
    4. Information from the Command Loop
    5. Input Events
      1. Keyboard Events
      2. Function Keys
      3. Click Events
      4. Drag Events
      5. Button-Down Events
      6. Repeat Events
      7. Motion Events
      8. Focus Events
      9. Event Examples
      10. Classifying Events
      11. Accessing Events
      12. Putting Keyboard Events in Strings
    6. Reading Input
      1. Key Sequence Input
      2. Reading One Event
      3. Quoted Character Input
      4. Peeking and Discarding
    7. Waiting for Elapsed Time or Input
    8. Quitting
    9. Prefix Command Arguments
    10. Recursive Editing
    11. Disabling Commands
    12. Command History
    13. Keyboard Macros
  20. Keymaps
    1. Keymap Terminology
    2. Format of Keymaps
    3. Creating Keymaps
    4. Inheritance and Keymaps
    5. Prefix Keys
    6. Menu Keymaps
      1. Defining Menus
      2. Menus and the Mouse
      3. Menus and the Keyboard
      4. Menu Example
      5. The Menu Bar
      6. Modifying Menus
    7. Active Keymaps
    8. Key Lookup
    9. Functions for Key Lookup
    10. Changing Key Bindings
    11. Commands for Binding Keys
    12. Scanning Keymaps
  21. Major and Minor Modes
    1. Major Modes
      1. Major Mode Conventions
      2. Major Mode Examples
      3. How Emacs Chooses a Major Mode
      4. Getting Help about a Major Mode
    2. Minor Modes
      1. Conventions for Writing Minor Modes
      2. Keymaps and Minor Modes
    3. Mode Line Format
      1. The Data Structure of the Mode Line
      2. Variables Used in the Mode Line
      3. %-Constructs in the Mode Line
    4. Hooks
  22. Documentation
    1. Documentation Basics
    2. Access to Documentation Strings
    3. Substituting Key Bindings in Documentation
    4. Describing Characters for Help Messages
    5. Help Functions
  23. Files
    1. Visiting Files
      1. Functions for Visiting Files
      2. Subroutines of Visiting
    2. Saving Buffers
    3. Reading from Files
    4. Writing to Files
    5. File Locks
    6. Information about Files
      1. Testing Accessibility
      2. Distinguishing Kinds of Files
      3. Truenames
      4. Other Information about Files
    7. Contents of Directories
    8. Creating and Deleting Directories
    9. Changing File Names and Attributes
    10. File Names
      1. File Name Components
      2. Directory Names
      3. Absolute and Relative File Names
      4. Functions that Expand Filenames
      5. Generating Unique File Names
      6. File Name Completion
    11. Making Certain File Names "Magic"
  24. Backups and Auto-Saving
    1. Backup Files
      1. Making Backup Files
      2. Backup by Renaming or by Copying?
      3. Making and Deleting Numbered Backup Files
      4. Naming Backup Files
    2. Auto-Saving
    3. Reverting
  25. Buffers
    1. Buffer Basics
    2. Buffer Names
    3. Buffer File Name
    4. Buffer Modification
    5. Comparison of Modification Time
    6. Read-Only Buffers
    7. The Buffer List
    8. Creating Buffers
    9. Killing Buffers
    10. The Current Buffer
  26. Windows
    1. Basic Concepts of Emacs Windows
    2. Splitting Windows
    3. Deleting Windows
    4. Selecting Windows
    5. Cycling Ordering of Windows
    6. Buffers and Windows
    7. Displaying Buffers in Windows
    8. Choosing a Window
    9. Window Point
    10. The Window Start Position
    11. Vertical Scrolling
    12. Horizontal Scrolling
    13. The Size of a Window
    14. Changing the Size of a Window
    15. Coordinates and Windows
    16. Window Configurations
  27. Frames
    1. Creating Frames
    2. Frame Parameters
      1. Access to Frame Parameters
      2. Initial Frame Parameters
      3. X Window Frame Parameters
      4. Frame Size And Position
    3. Deleting Frames
    4. Finding All Frames
    5. Frames and Windows
    6. Minibuffers and Frames
    7. Input Focus
    8. Visibility of Frames
    9. Raising and Lowering Frames
    10. Frame Configurations
    11. Mouse Tracking
    12. Mouse Position
    13. Pop-Up Menus
    14. X Selections
    15. X Server
      1. X Connections
      2. Resources
      3. Data about the X Server
  28. Positions
    1. Point
    2. Motion
      1. Motion by Characters
      2. Motion by Words
      3. Motion to an End of the Buffer
      4. Motion by Text Lines
      5. Motion by Screen Lines
      6. The User-Level Vertical Motion Commands
      7. Moving over Balanced Expressions
      8. Skipping Characters
    3. Excursions
    4. Narrowing
  29. Markers
    1. Overview of Markers
    2. Predicates on Markers
    3. Functions That Create Markers
    4. Information from Markers
    5. Changing Markers
    6. The Mark
    7. The Region
  30. Text
    1. Examining Text Near Point
    2. Examining Buffer Contents
    3. Comparing Text
    4. Insertion
    5. User-Level Insertion Commands
    6. Deletion of Text
    7. User-Level Deletion Commands
    8. The Kill Ring
      1. Kill Ring Concepts
      2. Functions for Killing
      3. Functions for Yanking
      4. Low Level Kill Ring
      5. Internals of the Kill Ring
    9. Undo
    10. Maintaining Undo Lists
    11. Filling
    12. Auto Filling
    13. Sorting Text
    14. Indentation
      1. Indentation Primitives
      2. Indentation Controlled by Major Mode
      3. Indenting an Entire Region
      4. Indentation Relative to Previous Lines
      5. Adjustable "Tab Stops"
      6. Indentation-Based Motion Commands
    15. Counting Columns
    16. Case Changes
    17. Text Properties
      1. Examining Text Properties
      2. Changing Text Properties
      3. Property Search Functions
      4. Special Properties
      5. Stickiness of Text Properties
      6. Why Text Properties are not Intervals
    18. Substituting for a Character Code
    19. Underlining
    20. Registers
    21. Change Hooks
  31. Searching and Matching
    1. Searching for Strings
    2. Regular Expressions
      1. Syntax of Regular Expressions
      2. Complex Regexp Example
    3. Regular Expression Searching
    4. Replacement
    5. The Match Data
      1. Simple Match Data Access
      2. Replacing the Text That Matched
      3. Accessing the Entire Match Data
      4. Saving and Restoring the Match Data
    6. Standard Regular Expressions Used in Editing
    7. Searching and Case
  32. Syntax Tables
    1. Syntax Descriptors
      1. Table of Syntax Classes
      2. Syntax Flags
    2. Syntax Table Functions
    3. Motion and Syntax
    4. Parsing Balanced Expressions
    5. Some Standard Syntax Tables
    6. Syntax Table Internals
  33. Abbrevs And Abbrev Expansion
    1. Setting Up Abbrev Mode
    2. Abbrev Tables
    3. Defining Abbrevs
    4. Saving Abbrevs in Files
    5. Looking Up and Expanding Abbreviations
    6. Standard Abbrev Tables
  34. Processes
    1. Functions that Create Subprocesses
    2. Creating a Synchronous Process
    3. Creating an Asynchronous Process
    4. Deleting Processes
    5. Process Information
    6. Sending Input to Processes
    7. Sending Signals to Processes
    8. Receiving Output from Processes
      1. Process Buffers
      2. Process Filter Functions
      3. Accepting Output from Processes
    9. Sentinels: Detecting Process Status Changes
    10. Transaction Queues
    11. TCP
  35. Operating System Interface
    1. Starting Up Emacs
      1. Summary: Sequence of Actions at Start Up
      2. The Init File: `.emacs'
      3. Terminal-Specific Initialization
      4. Command Line Arguments
    2. Getting out of Emacs
      1. Killing Emacs
      2. Suspending Emacs
    3. Operating System Environment
    4. User Identification
    5. Time of Day
    6. Timers
    7. Terminal Input
      1. Input Modes
      2. Translating Input Events
      3. Recording Input
    8. Terminal Output
    9. Flow Control
    10. Batch Mode
  36. Emacs Display
    1. Refreshing the Screen
    2. Screen Size
    3. Truncation
    4. The Echo Area
    5. Selective Display
    6. Overlay Arrow
    7. Temporary Displays
    8. Overlays
      1. Overlay Properties
      2. Managing Overlays
    9. Faces
      1. Merging Faces for Display
      2. Functions for Working with Faces
    10. Blinking
    11. Inverse Video
    12. Usual Display Conventions
    13. Display Tables
      1. Display Table Format
      2. Active Display Table
      3. Glyphs
      4. ISO Latin 1
    14. Beeping
    15. Window Systems
  37. Customizing the Calendar and Diary
    1. Customizing the Calendar
    2. Customizing the Holidays
    3. Date Display Format
    4. Time Display Format
    5. Daylight Savings Time
    6. Customizing the Diary
    7. Hebrew- and Islamic-Date Diary Entries
    8. Fancy Diary Display
    9. Included Diary Files
    10. Sexp Entries and the Fancy Diary Display
    11. Customizing Appointment Reminders
  38. Tips and Standards
    1. Writing Clean Lisp Programs
    2. Tips for Making Compiled Code Fast
    3. Tips for Documentation Strings
    4. Tips on Writing Comments
    5. Conventional Headers for Emacs Libraries
  39. GNU Emacs Internals
    1. Building Emacs
    2. Pure Storage
    3. Garbage Collection
    4. Writing Emacs Primitives
    5. Object Internals
      1. Buffer Internals
      2. Window Internals
      3. Process Internals
  40. Standard Errors
  41. Buffer-Local Variables
  42. Standard Keymaps
  43. Standard Hooks
  44. Emacs 18 Antinews
    1. Old Features in the Lisp Language
    2. Compilation Features
    3. Floating Point Numbers
    4. Changes in Basic Editing Functions
    5. Text Properties
    6. Features for Files
    7. Making Certain File Names "Magic"
    8. Frames
    9. X Window System Features
    10. Window Actions that Were No Longer Useful
    11. Display Features
    12. Working with Input Events
    13. Menus
    14. Changes in Minibuffer Features
    15. New Features for Defining Commands
    16. Removed Features for Reading Input
    17. Removed Syntax Table Features
    18. The Case Table
    19. Features for Dealing with Buffers
    20. Local Variables Features
    21. Features for Subprocesses
    22. Dealing with Times And Time Delays
    23. Features not Available for Lisp Debuggers
    24. Memory Allocation Changes
    25. Hook Changes