Emacs Lisp
- 1 Introduction
-
2 Lisp Data Types
- 2.1 Printed Representation and Read Syntax
- 2.2 Special Read Syntax
- 2.3 Comments
-
2.4 Programming Types
- 2.4.1 Integer Type
- 2.4.2 Floating-Point Type
- 2.4.3 Character Type
- 2.4.4 Symbol Type
- 2.4.5 Sequence Types
- 2.4.6 Cons Cell and List Types
- 2.4.7 Array Type
- 2.4.8 String Type
- 2.4.9 Vector Type
- 2.4.10 Char-Table Type
- 2.4.11 Bool-Vector Type
- 2.4.12 Hash Table Type
- 2.4.13 Function Type
- 2.4.14 Macro Type
- 2.4.15 Primitive Function Type
- 2.4.16 Closure Function Type
- 2.4.17 Record Type
- 2.4.18 Type Descriptors
- 2.4.19 Type Specifiers
- 2.4.20 Autoload Type
- 2.4.21 Finalizer Type
-
2.5 Editing Types
- 2.5.1 Buffer Type
- 2.5.2 Marker Type
- 2.5.3 Window Type
- 2.5.4 Frame Type
- 2.5.5 Terminal Type
- 2.5.6 Window Configuration Type
- 2.5.7 Frame Configuration Type
- 2.5.8 Process Type
- 2.5.9 Thread Type
- 2.5.10 Mutex Type
- 2.5.11 Condition Variable Type
- 2.5.12 Stream Type
- 2.5.13 Keymap Type
- 2.5.14 Overlay Type
- 2.5.15 Font Type
- 2.5.16 Xwidget Type
- 2.6 Read Syntax for Circular Objects
- 2.7 Type Predicates
- 2.8 Equality Predicates
- 2.9 Mutability
- 2.10 Type Hierarchy of Emacs Lisp Objects
- 3 Numbers
- 4 Strings and Characters
- 5 Lists
- 6 Sequences, Arrays, and Vectors
- 7 Records
- 8 Hash Tables
- 9 Symbols
- 10 Evaluation
- 11 Control Structures
-
12 Variables
- 12.1 Global Variables
- 12.2 Variables that Never Change
- 12.3 Local Variables
- 12.4 When a Variable is Void
- 12.5 Defining Global Variables
- 12.6 Tips for Defining Variables Robustly
- 12.7 Accessing Variable Values
- 12.8 Setting Variable Values
- 12.9 Running a function when a variable is changed.
- 12.10 Scoping Rules for Variable Bindings
- 12.11 Buffer-Local Variables
- 12.12 File Local Variables
- 12.13 Directory Local Variables
- 12.14 Connection Local Variables
- 12.15 Variable Aliases
- 12.16 Variables with Restricted Values
- 12.17 Generalized Variables
- 12.18 Multisession Variables
-
13 Functions
- 13.1 What Is a Function?
- 13.2 Lambda Expressions
- 13.3 Naming a Function
- 13.4 Defining Functions
- 13.5 Calling Functions
- 13.6 Mapping Functions
- 13.7 Anonymous Functions
- 13.8 Generic Functions
- 13.9 Accessing Function Cell Contents
- 13.10 Closures
- 13.11 Open Closures
- 13.12 Advising Emacs Lisp Functions
- 13.13 Declaring Functions Obsolete
- 13.14 Inline Functions
- 13.15 The
declareForm - 13.16 Telling the Compiler that a Function is Defined
- 13.17 Determining whether a Function is Safe to Call
- 13.18 Other Topics Related to Functions
- 14 Macros
- 15 Customization Settings
- 16 Loading
- 17 Byte Compilation
- 18 Compilation of Lisp to Native Code
-
19 Debugging Lisp Programs
-
19.1 The Lisp Debugger
- 19.1.1 Entering the Debugger on an Error
- 19.1.2 Debugging Redisplay Errors
- 19.1.3 Debugging Infinite Loops
- 19.1.4 Entering the Debugger on a Function Call
- 19.1.5 Entering the debugger when a variable is modified
- 19.1.6 Explicit Entry to the Debugger
- 19.1.7 Using the Debugger
- 19.1.8 Backtraces
- 19.1.9 Debugger Commands
- 19.1.10 Invoking the Debugger
- 19.1.11 Internals of the Debugger
-
19.2 Edebug
- 19.2.1 Using Edebug
- 19.2.2 Instrumenting for Edebug
- 19.2.3 Edebug Execution Modes
- 19.2.4 Jumping
- 19.2.5 Miscellaneous Edebug Commands
- 19.2.6 Breaks
- 19.2.7 Trapping Errors
- 19.2.8 Edebug Views
- 19.2.9 Evaluation
- 19.2.10 Evaluation List Buffer
- 19.2.11 Printing in Edebug
- 19.2.12 Trace Buffer
- 19.2.13 Coverage Testing
- 19.2.14 The Outside Context
- 19.2.15 Edebug and Macros
- 19.2.16 Edebug Options
- 19.3 Debugging Invalid Lisp Syntax
- 19.4 Test Coverage
- 19.5 Profiling
-
19.1 The Lisp Debugger
- 20 Reading and Printing Lisp Objects
-
21 Minibuffers
- 21.1 Introduction to Minibuffers
- 21.2 Reading Text Strings with the Minibuffer
- 21.3 Reading Lisp Objects with the Minibuffer
- 21.4 Minibuffer History
- 21.5 Initial Input
- 21.6 Completion
- 21.7 Yes-or-No Queries
- 21.8 Asking Multiple-Choice Questions
- 21.9 Reading a Password
- 21.10 Minibuffer Commands
- 21.11 Minibuffer Windows
- 21.12 Minibuffer Contents
- 21.13 Recursive Minibuffers
- 21.14 Inhibiting Interaction
- 21.15 Minibuffer Miscellany
-
22 Command Loop
- 22.1 Command Loop Overview
- 22.2 Defining Commands
- 22.3 Interactive Call
- 22.4 Distinguish Interactive Calls
- 22.5 Information from the Command Loop
- 22.6 Adjusting Point After Commands
-
22.7 Input Events
- 22.7.1 Keyboard Events
- 22.7.2 Function Keys
- 22.7.3 Mouse Events
- 22.7.4 Click Events
- 22.7.5 Drag Events
- 22.7.6 Button-Down Events
- 22.7.7 Repeat Events
- 22.7.8 Motion Events
- 22.7.9 Touchscreen Events
- 22.7.10 Focus Events
- 22.7.11 Xwidget events
- 22.7.12 Miscellaneous System Events
- 22.7.13 Event Examples
- 22.7.14 Classifying Events
- 22.7.15 Accessing Mouse Events
- 22.7.16 Accessing Scroll Bar Events
- 22.7.17 Putting Keyboard Events in Strings
- 22.8 Reading Input
- 22.9 Special Events
- 22.10 Waiting for Elapsed Time or Input
- 22.11 Quitting
- 22.12 Prefix Command Arguments
- 22.13 Recursive Editing
- 22.14 Disabling Commands
- 22.15 Command History
- 22.16 Keyboard Macros
-
23 Keymaps
- 23.1 Keymap Basics
- 23.2 Changing Key Bindings
- 23.3 Format of Keymaps
- 23.4 Creating Keymaps
- 23.5 Inheritance and Keymaps
- 23.6 Prefix Keys
- 23.7 Active Keymaps
- 23.8 Searching the Active Keymaps
- 23.9 Controlling the Active Keymaps
- 23.10 Key Lookup
- 23.11 Functions for Key Lookup
- 23.12 Key Sequences
- 23.13 Low-Level Key Binding
- 23.14 Remapping Commands
- 23.15 Keymaps for Translating Sequences of Events
- 23.16 Commands for Binding Keys
- 23.17 Scanning Keymaps
- 23.18 Menu Keymaps
-
24 Major and Minor Modes
- 24.1 Hooks
- 24.2 Major Modes
- 24.3 Minor Modes
-
24.4 Mode Line Format
- 24.4.1 Mode Line Basics
- 24.4.2 The Data Structure of the Mode Line
- 24.4.3 The Top Level of Mode Line Control
- 24.4.4 Variables Used in the Mode Line
- 24.4.5
%-Constructs in the Mode Line - 24.4.6 Properties in the Mode Line
- 24.4.7 Window Header Lines
- 24.4.8 Window Tab Lines
- 24.4.9 Emulating Mode Line Formatting
- 24.5 Imenu
- 24.6 Outline Minor Mode
-
24.7 Font Lock Mode
- 24.7.1 Font Lock Basics
- 24.7.2 Search-based Fontification
- 24.7.3 Customizing Search-Based Fontification
- 24.7.4 Other Font Lock Variables
- 24.7.5 Levels of Font Lock
- 24.7.6 Precalculated Fontification
- 24.7.7 Faces for Font Lock
- 24.7.8 Syntactic Font Lock
- 24.7.9 Multiline Font Lock Constructs
- 24.7.10 Parser-based Font Lock
-
24.8 Automatic Indentation of code
-
24.8.1 Simple Minded Indentation Engine
- 24.8.1.1 SMIE Setup and Features
- 24.8.1.2 Operator Precedence Grammars
- 24.8.1.3 Defining the Grammar of a Language
- 24.8.1.4 Defining Tokens
- 24.8.1.5 Living With a Weak Parser
- 24.8.1.6 Specifying Indentation Rules
- 24.8.1.7 Helper Functions for Indentation Rules
- 24.8.1.8 Sample Indentation Rules
- 24.8.1.9 Customizing Indentation
- 24.8.2 Parser-based Indentation
-
24.8.1 Simple Minded Indentation Engine
- 24.9 Desktop Save Mode
- 25 Documentation
-
26 Files
- 26.1 Visiting Files
- 26.2 Saving Buffers
- 26.3 Reading from Files
- 26.4 Writing to Files
- 26.5 File Locks
- 26.6 Information about Files
- 26.7 Changing File Names and Attributes
- 26.8 Files and Secondary Storage
- 26.9 File Names
- 26.10 Contents of Directories
- 26.11 Creating, Copying and Deleting Directories
- 26.12 Making Certain File Names “Magic”
- 26.13 File Format Conversion
- 27 Backups and Auto-Saving
-
28 Buffers
- 28.1 Buffer Basics
- 28.2 The Current Buffer
- 28.3 Buffer Names
- 28.4 Buffer File Name
- 28.5 Buffer Modification
- 28.6 Buffer Modification Time
- 28.7 Read-Only Buffers
- 28.8 The Buffer List
- 28.9 Creating Buffers
- 28.10 Killing Buffers
- 28.11 Indirect Buffers
- 28.12 Swapping Text Between Two Buffers
- 28.13 The Buffer Gap
-
29 Windows
- 29.1 Basic Concepts of Emacs Windows
- 29.2 Windows and Frames
- 29.3 Selecting Windows
- 29.4 Window Sizes
- 29.5 Resizing Windows
- 29.6 Preserving Window Sizes
- 29.7 Splitting Windows
- 29.8 Deleting Windows
- 29.9 Recombining Windows
- 29.10 Resurrecting Windows
- 29.11 Changing Window Layouts
- 29.12 Cyclic Ordering of Windows
- 29.13 Buffers and Windows
- 29.14 Switching to a Buffer in a Window
- 29.15 Displaying a Buffer in a Suitable Window
- 29.16 Window History
- 29.17 Dedicated Windows
- 29.18 Quitting Windows
- 29.19 Side Windows
- 29.20 Atomic Windows
- 29.21 Windows and Point
- 29.22 The Window Start and End Positions
- 29.23 Textual Scrolling
- 29.24 Vertical Fractional Scrolling
- 29.25 Horizontal Scrolling
- 29.26 Coordinates and Windows
- 29.27 Mouse Window Auto-selection
- 29.28 Window Configurations
- 29.29 Window Parameters
- 29.30 Hooks for Window Scrolling and Changes
-
30 Frames
- 30.1 Creating Frames
- 30.2 Multiple Terminals
- 30.3 Frame Geometry
-
30.4 Frame Parameters
- 30.4.1 Access to Frame Parameters
- 30.4.2 Initial Frame Parameters
-
30.4.3 Window Frame Parameters
- 30.4.3.1 Basic Parameters
- 30.4.3.2 Position Parameters
- 30.4.3.3 Size Parameters
- 30.4.3.4 Layout Parameters
- 30.4.3.5 Buffer Parameters
- 30.4.3.6 Frame Interaction Parameters
- 30.4.3.7 Mouse Dragging Parameters
- 30.4.3.8 Window Management Parameters
- 30.4.3.9 Cursor Parameters
- 30.4.3.10 Font and Color Parameters
- 30.4.4 Geometry
- 30.5 Terminal Parameters
- 30.6 Frame Titles
- 30.7 Deleting Frames
- 30.8 Finding All Frames
- 30.9 Splitting and Merging Frames
- 30.10 Minibuffers and Frames
- 30.11 Input Focus
- 30.12 Visibility of Frames
- 30.13 Raising, Lowering and Restacking Frames
- 30.14 Frame Configurations
- 30.15 Child Frames
- 30.16 Mouse Tracking
- 30.17 Mouse Position
- 30.18 Pop-Up Menus
- 30.19 On-Screen Keyboards
- 30.20 Dialog Boxes
- 30.21 Pointer Shape
- 30.22 Window System Selections
- 30.23 Accessing Selections
- 30.24 Yanking Media
- 30.25 Drag and Drop
- 30.26 Color Names
- 30.27 Text Terminal Colors
- 30.28 X Resources
- 30.29 Display Feature Testing
- 31 Positions
- 32 Markers
-
33 Text
- 33.1 Examining Text Near Point
- 33.2 Examining Buffer Contents
- 33.3 Comparing Text
- 33.4 Inserting Text
- 33.5 User-Level Insertion Commands
- 33.6 Deleting Text
- 33.7 User-Level Deletion Commands
- 33.8 The Kill Ring
- 33.9 Undo
- 33.10 Maintaining Undo Lists
- 33.11 Filling
- 33.12 Margins for Filling
- 33.13 Adaptive Fill Mode
- 33.14 Auto Filling
- 33.15 Sorting Text
- 33.16 Counting Columns
- 33.17 Indentation
- 33.18 Case Changes
-
33.19 Text Properties
- 33.19.1 Examining Text Properties
- 33.19.2 Changing Text Properties
- 33.19.3 Text Property Search Functions
- 33.19.4 Properties with Special Meanings
- 33.19.5 Formatted Text Properties
- 33.19.6 Stickiness of Text Properties
- 33.19.7 Lazy Computation of Text Properties
- 33.19.8 Defining Clickable Text
- 33.19.9 Defining and Using Fields
- 33.19.10 Why Text Properties are not Intervals
- 33.20 Substituting for a Character Code
- 33.21 Registers
- 33.22 Transposition of Text
- 33.23 Replacing Buffer Text
- 33.24 Dealing With Compressed Data
- 33.25 Base 64 Encoding
- 33.26 Checksum/Hash
- 33.27 Suspicious Text
- 33.28 GnuTLS Cryptography
- 33.29 Database
- 33.30 Parsing HTML and XML
- 33.31 Parsing and generating JSON values
- 33.32 JSONRPC communication
- 33.33 Atomic Change Groups
- 33.34 Change Hooks
-
34 Non-ASCII Characters
- 34.1 Text Representations
- 34.2 Disabling Multibyte Characters
- 34.3 Converting Text Representations
- 34.4 Selecting a Representation
- 34.5 Character Codes
- 34.6 Character Properties
- 34.7 Character Sets
- 34.8 Scanning for Character Sets
- 34.9 Translation of Characters
- 34.10 Coding Systems
- 34.11 Input Methods
- 34.12 Locales
-
35 Searching and Matching
- 35.1 Searching for Strings
- 35.2 Searching and Case
- 35.3 Regular Expressions
- 35.4 Regular Expression Searching
- 35.5 Longest-match searching for regular expression matches
- 35.6 The Match Data
- 35.7 Search and Replace
- 35.8 Standard Regular Expressions Used in Editing
- 35.9 Emacs versus POSIX Regular Expressions
- 36 Syntax Tables
- 37 Parsing Expression Grammars
-
38 Parsing Program Source
- 38.1 Tree-sitter Language Grammar
- 38.2 Using Tree-sitter Parser
- 38.3 Retrieving Nodes
- 38.4 Accessing Node Information
- 38.5 Pattern Matching Tree-sitter Nodes
- 38.6 User-defined “Things” and Navigation
- 38.7 Parsing Text in Multiple Languages
- 38.8 Developing major modes with tree-sitter
- 38.9 Tree-sitter C API Correspondence
- 39 Abbrevs and Abbrev Expansion
- 40 Threads
-
41 Processes
- 41.1 Functions that Create Subprocesses
- 41.2 Shell Arguments
- 41.3 Creating a Synchronous Process
- 41.4 Creating an Asynchronous Process
- 41.5 Deleting Processes
- 41.6 Process Information
- 41.7 Sending Input to Processes
- 41.8 Sending Signals to Processes
- 41.9 Receiving Output from Processes
- 41.10 Sentinels: Detecting Process Status Changes
- 41.11 Querying Before Exit
- 41.12 Accessing Other Processes
- 41.13 Transaction Queues
- 41.14 Network Connections
- 41.15 Network Servers
- 41.16 Datagrams
- 41.17 Low-Level Network Access
- 41.18 Misc Network Facilities
- 41.19 Communicating with Serial Ports
- 41.20 Packing and Unpacking Byte Arrays
-
42 Emacs Display
- 42.1 Refreshing the Screen
- 42.2 Forcing Redisplay
- 42.3 Truncation
- 42.4 The Echo Area
- 42.5 Reporting Warnings
- 42.6 Invisible Text
- 42.7 Selective Display
- 42.8 Temporary Displays
- 42.9 Overlays
- 42.10 Size of Displayed Text
- 42.11 Line Height
-
42.12 Faces
- 42.12.1 Face Attributes
- 42.12.2 Defining Faces
- 42.12.3 Face Attribute Functions
- 42.12.4 Displaying Faces
- 42.12.5 Face Remapping
- 42.12.6 Functions for Working with Faces
- 42.12.7 Automatic Face Assignment
- 42.12.8 Basic Faces
- 42.12.9 Font Selection
- 42.12.10 Looking Up Fonts
- 42.12.11 Fontsets
- 42.12.12 Low-Level Font Representation
- 42.13 Fringes
- 42.14 Scroll Bars
- 42.15 Window Dividers
-
42.16 The
displayProperty - 42.17 Images
- 42.18 Icons
- 42.19 Embedded Native Widgets
- 42.20 Buttons
- 42.21 Abstract Display
- 42.22 Blinking Parentheses
- 42.23 Character Display
- 42.24 Beeping
- 42.25 Window Systems
- 42.26 Tooltips
- 42.27 Bidirectional Display
-
43 Operating System Interface
- 43.1 Starting Up Emacs
- 43.2 Getting Out of Emacs
- 43.3 Operating System Environment
- 43.4 User Identification
- 43.5 Time of Day
- 43.6 Time Zone Rules
- 43.7 Time Conversion
- 43.8 Parsing and Formatting Times
- 43.9 Processor Run time
- 43.10 Time Calculations
- 43.11 Timers for Delayed Execution
- 43.12 Idle Timers
- 43.13 Terminal Input
- 43.14 Terminal Output
- 43.15 Sound Output
- 43.16 Operating on X11 Keysyms
- 43.17 Batch Mode
- 43.18 Session Management
- 43.19 Desktop Notifications
- 43.20 Controlling System GUI Taskbar Features
- 43.21 Block System Sleep and Process Sleep Events
- 43.22 Notifications on File Changes
- 43.23 Dynamically Loaded Libraries
- 43.24 Security Considerations
- 44 Preparing Lisp code for distribution
- Appendix A Emacs 30 Antinews
- Appendix B GNU Free Documentation License
- Appendix C GNU General Public License
-
Appendix D Tips and Conventions
- D.1 Emacs Lisp Coding Conventions
- D.2 Key Binding Conventions
- D.3 Emacs Programming Tips
- D.4 Tips for Making Compiled Code Fast
- D.5 Tips for Avoiding Compiler Warnings
- D.6 Tips for Documentation Strings
- D.7 Tips for Documentation Groups
- D.8 Tips on Writing Comments
- D.9 Conventional Headers for Emacs Libraries
- Appendix E GNU Emacs Internals
- Appendix F Standard Errors
- Appendix G Standard Keymaps
- Appendix H Standard Hooks
- Index
Copyright © 1990-1996, 1998-2026 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html