1 \input texinfo @c -*-texinfo-*-
4 @settitle GNU Emacs Lisp Reference Manual
7 @c Version of the manual and of Emacs.
8 @c Please remember to update the edition number in README as well.
14 * Elisp: (elisp). The Emacs Lisp Reference Manual.
18 @setchapternewpage odd
26 @c We use the "type index" to index new functions and variables.
27 @c @syncodeindex tp fn
30 This is edition @value{VERSION} of the GNU Emacs Lisp
31 Reference Manual, corresponding to Emacs version @value{EMACSVER}.
33 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
34 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
37 Permission is granted to copy, distribute and/or modify this document
38 under the terms of the GNU Free Documentation License, Version 1.2 or
39 any later version published by the Free Software Foundation; with the
40 Invariant Sections being ``GNU General Public License'', with the
41 Front-Cover texts being ``A GNU Manual'', and with the Back-Cover
42 Texts as in (a) below. A copy of the license is included in the
43 section entitled ``GNU Free Documentation License''.
45 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
46 this GNU Manual, like GNU software. Copies published by the Free
47 Software Foundation raise funds for GNU development.''
52 @title GNU Emacs Lisp Reference Manual
53 @subtitle For Emacs Version @value{EMACSVER}
54 @subtitle Revision @value{VERSION}, January 2002
56 @author by Bil Lewis, Dan LaLiberte, Richard Stallman
57 @author and the GNU Manual Group
59 @vskip 0pt plus 1filll
63 Published by the Free Software Foundation @*
64 51 Franklin St, Fifth Floor @*
65 Boston, MA 02110-1301 @*
70 Cover art by Etienne Suvasa.
74 @c Print the tables of contents
80 @node Top, Introduction, (dir), (dir)
83 This Info file contains edition @value{VERSION} of the GNU Emacs Lisp
84 Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}.
88 * Introduction:: Introduction and conventions used.
90 * Lisp Data Types:: Data types of objects in Emacs Lisp.
91 * Numbers:: Numbers and arithmetic functions.
92 * Strings and Characters:: Strings, and functions that work on them.
93 * Lists:: Lists, cons cells, and related functions.
94 * Sequences Arrays Vectors:: Lists, strings and vectors are called sequences.
95 Certain functions act on any kind of sequence.
96 The description of vectors is here as well.
97 * Hash Tables:: Very fast lookup-tables.
98 * Symbols:: Symbols represent names, uniquely.
100 * Evaluation:: How Lisp expressions are evaluated.
101 * Control Structures:: Conditionals, loops, nonlocal exits.
102 * Variables:: Using symbols in programs to stand for values.
103 * Functions:: A function is a Lisp program
104 that can be invoked from other functions.
105 * Macros:: Macros are a way to extend the Lisp language.
106 * Customization:: Writing customization declarations.
108 * Loading:: Reading files of Lisp code into Lisp.
109 * Byte Compilation:: Compilation makes programs run faster.
110 * Advising Functions:: Adding to the definition of a function.
111 * Debugging:: Tools and tips for debugging Lisp programs.
113 * Read and Print:: Converting Lisp objects to text and back.
114 * Minibuffers:: Using the minibuffer to read input.
115 * Command Loop:: How the editor command loop works,
116 and how you can call its subroutines.
117 * Keymaps:: Defining the bindings from keys to commands.
118 * Modes:: Defining major and minor modes.
119 * Documentation:: Writing and using documentation strings.
121 * Files:: Accessing files.
122 * Backups and Auto-Saving:: Controlling how backups and auto-save
124 * Buffers:: Creating and using buffer objects.
125 * Windows:: Manipulating windows and displaying buffers.
126 * Frames:: Making multiple system-level windows.
127 * Positions:: Buffer positions and motion functions.
128 * Markers:: Markers represent positions and update
129 automatically when the text is changed.
131 * Text:: Examining and changing text in buffers.
132 * Non-ASCII Characters:: Non-ASCII text in buffers and strings.
133 * Searching and Matching:: Searching buffers for strings or regexps.
134 * Syntax Tables:: The syntax table controls word and list parsing.
135 * Abbrevs:: How Abbrev mode works, and its data structures.
137 * Processes:: Running and communicating with subprocesses.
138 * Display:: Features for controlling the screen display.
139 * System Interface:: Getting the user id, system type, environment
140 variables, and other such things.
144 * Antinews:: Info for users downgrading to Emacs 21.
145 * GNU Free Documentation License:: The license for this documentation
146 * GPL:: Conditions for copying and changing GNU Emacs.
147 * Tips:: Advice and coding conventions for Emacs Lisp.
148 * GNU Emacs Internals:: Building and dumping Emacs;
149 internal data structures.
150 * Standard Errors:: List of all error symbols.
151 * Standard Buffer-Local Variables::
152 List of variables buffer-local in all buffers.
153 * Standard Keymaps:: List of standard keymaps.
154 * Standard Hooks:: List of standard hook variables.
156 * Index:: Index including concepts, functions, variables,
159 * New Symbols:: New functions and variables in Emacs @value{EMACSVER}.
161 Detailed Node Listing
162 ---------------------
164 Here are other nodes that are inferiors of those already listed,
165 mentioned here so you can get to them in one step:
169 * Caveats:: Flaws and a request for help.
170 * Lisp History:: Emacs Lisp is descended from Maclisp.
171 * Conventions:: How the manual is formatted.
172 * Version Info:: Which Emacs version is running?
173 * Acknowledgements:: The authors, editors, and sponsors of this manual.
177 * Some Terms:: Explanation of terms we use in this manual.
178 * nil and t:: How the symbols @code{nil} and @code{t} are used.
179 * Evaluation Notation:: The format we use for examples of evaluation.
180 * Printing Notation:: The format we use for examples that print output.
181 * Error Messages:: The format we use for examples of errors.
182 * Buffer Text Notation:: The format we use for buffer contents in examples.
183 * Format of Descriptions:: Notation for describing functions, variables, etc.
185 Format of Descriptions
187 * A Sample Function Description::
188 * A Sample Variable Description::
192 * Printed Representation:: How Lisp objects are represented as text.
193 * Comments:: Comments and their formatting conventions.
194 * Programming Types:: Types found in all Lisp systems.
195 * Editing Types:: Types specific to Emacs.
196 * Circular Objects:: Read syntax for circular structure.
197 * Type Predicates:: Tests related to types.
198 * Equality Predicates:: Tests of equality between any two objects.
202 * Integer Type:: Numbers without fractional parts.
203 * Floating Point Type:: Numbers with fractional parts and with a large range.
204 * Character Type:: The representation of letters, numbers and
206 * Symbol Type:: A multi-use object that refers to a function,
207 variable, property list, or itself.
208 * Sequence Type:: Both lists and arrays are classified as sequences.
209 * Cons Cell Type:: Cons cells, and lists (which are made from cons cells).
210 * Array Type:: Arrays include strings and vectors.
211 * String Type:: An (efficient) array of characters.
212 * Vector Type:: One-dimensional arrays.
213 * Char-Table Type:: One-dimensional sparse arrays indexed by characters.
214 * Bool-Vector Type:: One-dimensional arrays of @code{t} or @code{nil}.
215 * Hash Table Type:: Super-fast lookup tables.
216 * Function Type:: A piece of executable code you can call from elsewhere.
217 * Macro Type:: A method of expanding an expression into another
218 expression, more fundamental but less pretty.
219 * Primitive Function Type:: A function written in C, callable from Lisp.
220 * Byte-Code Type:: A function written in Lisp, then compiled.
221 * Autoload Type:: A type used for automatically loading seldom-used
224 Cons Cell and List Types
226 * Box Diagrams:: Drawing pictures of lists.
227 * Dotted Pair Notation:: An alternative syntax for lists.
228 * Association List Type:: A specially constructed list.
232 * Buffer Type:: The basic object of editing.
233 * Marker Type:: A position in a buffer.
234 * Window Type:: What makes buffers visible.
235 * Frame Type:: Windows subdivide frames.
236 * Window Configuration Type::Save what the screen looks like.
237 * Frame Configuration Type::Recording the status of all frames.
238 * Process Type:: A process running on the underlying OS.
239 * Stream Type:: Receive or send characters.
240 * Keymap Type:: What function a keystroke invokes.
241 * Overlay Type:: How an overlay is represented.
245 * Integer Basics:: Representation and range of integers.
246 * Float Basics:: Representation and range of floating point.
247 * Predicates on Numbers:: Testing for numbers.
248 * Comparison of Numbers:: Equality and inequality predicates.
249 * Numeric Conversions:: Converting float to integer and vice versa.
250 * Arithmetic Operations:: How to add, subtract, multiply and divide.
251 * Rounding Operations:: Explicitly rounding floating point numbers.
252 * Bitwise Operations:: Logical and, or, not, shifting.
253 * Math Functions:: Trig, exponential and logarithmic functions.
254 * Random Numbers:: Obtaining random integers, predictable or not.
256 Strings and Characters
258 * String Basics:: Basic properties of strings and characters.
259 * Predicates for Strings:: Testing whether an object is a string or char.
260 * Creating Strings:: Functions to allocate new strings.
261 * Modifying Strings:: Altering the contents of an existing string.
262 * Text Comparison:: Comparing characters or strings.
263 * String Conversion:: Converting characters or strings and vice versa.
264 * Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}.
265 * Case Conversion:: Case conversion functions.
266 * Case Tables:: Customizing case conversion.
270 * Cons Cells:: How lists are made out of cons cells.
271 * List-related Predicates:: Is this object a list? Comparing two lists.
272 * List Elements:: Extracting the pieces of a list.
273 * Building Lists:: Creating list structure.
274 * Modifying Lists:: Storing new pieces into an existing list.
275 * Sets And Lists:: A list can represent a finite mathematical set.
276 * Association Lists:: A list can represent a finite relation or mapping.
277 * Rings:: Managing a fixed-size ring of objects.
279 Modifying Existing List Structure
281 * Setcar:: Replacing an element in a list.
282 * Setcdr:: Replacing part of the list backbone.
283 This can be used to remove or add elements.
284 * Rearrangement:: Reordering the elements in a list; combining lists.
286 Sequences, Arrays, and Vectors
288 * Sequence Functions:: Functions that accept any kind of sequence.
289 * Arrays:: Characteristics of arrays in Emacs Lisp.
290 * Array Functions:: Functions specifically for arrays.
291 * Vectors:: Functions specifically for vectors.
292 * Vector Functions:: Functions specifically for vectors.
293 * Char-Tables:: How to work with char-tables.
294 * Bool-Vectors:: How to work with bool-vectors.
298 * Creating Hash:: Functions to create hash tables.
299 * Hash Access:: Reading and writing the hash table contents.
300 * Defining Hash:: Defining new comparison methods
301 * Other Hash:: Miscellaneous.
305 * Symbol Components:: Symbols have names, values, function definitions
307 * Definitions:: A definition says how a symbol will be used.
308 * Creating Symbols:: How symbols are kept unique.
309 * Property Lists:: Each symbol has a property list
310 for recording miscellaneous information.
314 * Intro Eval:: Evaluation in the scheme of things.
315 * Forms:: How various sorts of objects are evaluated.
316 * Quoting:: Avoiding evaluation (to put constants in
318 * Eval:: How to invoke the Lisp interpreter explicitly.
322 * Self-Evaluating Forms:: Forms that evaluate to themselves.
323 * Symbol Forms:: Symbols evaluate as variables.
324 * Classifying Lists:: How to distinguish various sorts of list forms.
325 * Function Indirection:: When a symbol appears as the car of a list,
326 we find the real function via the symbol.
327 * Function Forms:: Forms that call functions.
328 * Macro Forms:: Forms that call macros.
329 * Special Forms:: ``Special forms'' are idiosyncratic primitives,
330 most of them extremely important.
331 * Autoloading:: Functions set up to load files
332 containing their real definitions.
336 * Sequencing:: Evaluation in textual order.
337 * Conditionals:: @code{if}, @code{cond}, @code{when}, @code{unless}.
338 * Combining Conditions:: @code{and}, @code{or}, @code{not}.
339 * Iteration:: @code{while} loops.
340 * Nonlocal Exits:: Jumping out of a sequence.
344 * Catch and Throw:: Nonlocal exits for the program's own purposes.
345 * Examples of Catch:: Showing how such nonlocal exits can be written.
346 * Errors:: How errors are signaled and handled.
347 * Cleanups:: Arranging to run a cleanup form if an
352 * Signaling Errors:: How to report an error.
353 * Processing of Errors:: What Emacs does when you report an error.
354 * Handling Errors:: How you can trap errors and continue execution.
355 * Error Symbols:: How errors are classified for trapping them.
359 * Global Variables:: Variable values that exist permanently, everywhere.
360 * Constant Variables:: Certain "variables" have values that never change.
361 * Local Variables:: Variable values that exist only temporarily.
362 * Void Variables:: Symbols that lack values.
363 * Defining Variables:: A definition says a symbol is used as a variable.
364 * Tips for Defining:: Things you should think about when you
366 * Accessing Variables:: Examining values of variables whose names
367 are known only at run time.
368 * Setting Variables:: Storing new values in variables.
369 * Variable Scoping:: How Lisp chooses among local and global values.
370 * Buffer-Local Variables:: Variable values in effect only in one buffer.
371 * Frame-Local Variables:: Variable values in effect only in one frame.
372 * Future Local Variables:: New kinds of local values we might add some day.
373 * File Local Variables:: Handling local variable lists in files.
374 * Variable Aliases:: Variables that are aliases for other variables.
375 * Variables with Restricted Values:: Non-constant variables whose value can
376 @emph{not} be an arbitrary Lisp object.
378 Scoping Rules for Variable Bindings
380 * Scope:: Scope means where in the program a value
381 is visible. Comparison with other languages.
382 * Extent:: Extent means how long in time a value exists.
383 * Impl of Scope:: Two ways to implement dynamic scoping.
384 * Using Scoping:: How to use dynamic scoping carefully and
387 Buffer-Local Variables
389 * Intro to Buffer-Local:: Introduction and concepts.
390 * Creating Buffer-Local:: Creating and destroying buffer-local bindings.
391 * Default Value:: The default value is seen in buffers
392 that don't have their own buffer-local values.
396 * What Is a Function:: Lisp functions vs primitives; terminology.
397 * Lambda Expressions:: How functions are expressed as Lisp objects.
398 * Function Names:: A symbol can serve as the name of a function.
399 * Defining Functions:: Lisp expressions for defining functions.
400 * Calling Functions:: How to use an existing function.
401 * Mapping Functions:: Applying a function to each element of a list, etc.
402 * Anonymous Functions:: Lambda-expressions are functions with no names.
403 * Function Cells:: Accessing or setting the function definition
405 * Obsolete Functions:: Declaring functions obsolete.
406 * Inline Functions:: Defining functions that the compiler will open code.
407 * Function Safety:: Determining whether a function is safe to call.
408 * Related Topics:: Cross-references to specific Lisp primitives
409 that have a special bearing on how
414 * Lambda Components:: The parts of a lambda expression.
415 * Simple Lambda:: A simple example.
416 * Argument List:: Details and special features of argument lists.
417 * Function Documentation:: How to put documentation in a function.
421 * Simple Macro:: A basic example.
422 * Expansion:: How, when and why macros are expanded.
423 * Compiling Macros:: How macros are expanded by the compiler.
424 * Defining Macros:: How to write a macro definition.
425 * Backquote:: Easier construction of list structure.
426 * Problems with Macros:: Don't evaluate the macro arguments too many times.
427 Don't hide the user's variables.
428 * Indenting Macros:: Specifying how to indent macro calls.
430 Writing Customization Definitions
432 * Common Keywords:: Common keyword arguments for all kinds of
433 customization declarations.
434 * Group Definitions:: Writing customization group definitions.
435 * Variable Definitions:: Declaring user options.
436 * Customization Types:: Specifying the type of a user option.
440 * How Programs Do Loading:: The @code{load} function and others.
441 * Library Search:: Finding a library to load.
442 * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files.
443 * Autoload:: Setting up a function to autoload.
444 * Repeated Loading:: Precautions about loading a file twice.
445 * Named Features:: Loading a library if it isn't already loaded.
446 * Where Defined:: Finding which file defined a certain symbol.
447 * Unloading:: How to ``unload'' a library that was loaded.
448 * Hooks for Loading:: Providing code to be run when
449 particular libraries are loaded.
453 * Speed of Byte-Code:: An example of speedup from byte compilation.
454 * Compilation Functions:: Byte compilation functions.
455 * Docs and Compilation:: Dynamic loading of documentation strings.
456 * Dynamic Loading:: Dynamic loading of individual functions.
457 * Eval During Compile:: Code to be evaluated when you compile.
458 * Compiler Errors:: Handling compiler error messages.
459 * Byte-Code Objects:: The data type used for byte-compiled functions.
460 * Disassembly:: Disassembling byte-code; how to read byte-code.
462 Advising Emacs Lisp Functions
464 * Simple Advice:: A simple example to explain the basics of advice.
465 * Defining Advice:: Detailed description of @code{defadvice}.
466 * Around-Advice:: Wrapping advice around a function's definition.
467 * Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
468 * Activation of Advice:: Advice doesn't do anything until you activate it.
469 * Enabling Advice:: You can enable or disable each piece of advice.
470 * Preactivation:: Preactivation is a way of speeding up the
471 loading of compiled advice.
472 * Argument Access in Advice:: How advice can access the function's arguments.
473 * Advising Primitives:: Accessing arguments when advising a primitive.
474 * Combined Definition:: How advice is implemented.
476 Debugging Lisp Programs
478 * Debugger:: How the Emacs Lisp debugger is implemented.
479 * Edebug:: A source-level Emacs Lisp debugger.
480 * Syntax Errors:: How to find syntax errors.
481 * Test Coverage:: Ensuring you have tested all branches in your code.
482 * Compilation Errors:: How to find errors that show up in
487 * Error Debugging:: Entering the debugger when an error happens.
488 * Infinite Loops:: Stopping and debugging a program that doesn't exit.
489 * Function Debugging:: Entering it when a certain function is called.
490 * Explicit Debug:: Entering it at a certain point in the program.
491 * Using Debugger:: What the debugger does; what you see while in it.
492 * Debugger Commands:: Commands used while in the debugger.
493 * Invoking the Debugger:: How to call the function @code{debug}.
494 * Internals of Debugger:: Subroutines of the debugger, and global variables.
498 * Using Edebug:: Introduction to use of Edebug.
499 * Instrumenting:: You must instrument your code
500 in order to debug it with Edebug.
501 * Edebug Execution Modes:: Execution modes, stopping more or less often.
502 * Jumping:: Commands to jump to a specified place.
503 * Edebug Misc:: Miscellaneous commands.
504 * Breaks:: Setting breakpoints to make the program stop.
505 * Trapping Errors:: Trapping errors with Edebug.
506 * Edebug Views:: Views inside and outside of Edebug.
507 * Edebug Eval:: Evaluating expressions within Edebug.
508 * Eval List:: Expressions whose values are displayed
509 each time you enter Edebug.
510 * Printing in Edebug:: Customization of printing.
511 * Trace Buffer:: How to produce trace output in a buffer.
512 * Coverage Testing:: How to test evaluation coverage.
513 * The Outside Context:: Data that Edebug saves and restores.
514 * Edebug and Macros:: Specifying how to handle macro calls.
515 * Edebug Options:: Option variables for customizing Edebug.
517 Debugging Invalid Lisp Syntax
519 * Excess Open:: How to find a spurious open paren or missing close.
520 * Excess Close:: How to find a spurious close paren or missing open.
522 Reading and Printing Lisp Objects
524 * Streams Intro:: Overview of streams, reading and printing.
525 * Input Streams:: Various data types that can be used as
527 * Input Functions:: Functions to read Lisp objects from text.
528 * Output Streams:: Various data types that can be used as
530 * Output Functions:: Functions to print Lisp objects as text.
531 * Output Variables:: Variables that control what the printing
536 * Intro to Minibuffers:: Basic information about minibuffers.
537 * Text from Minibuffer:: How to read a straight text string.
538 * Object from Minibuffer:: How to read a Lisp object or expression.
539 * Minibuffer History:: Recording previous minibuffer inputs
540 so the user can reuse them.
541 * Initial Input:: Specifying initial contents for the minibuffer.
542 * Completion:: How to invoke and customize completion.
543 * Yes-or-No Queries:: Asking a question with a simple answer.
544 * Multiple Queries:: Asking a series of similar questions.
545 * Reading a Password:: Reading a password from the terminal.
546 * Minibuffer Commands:: Commands used as key bindings in minibuffers.
547 * Minibuffer Contents:: How such commands access the minibuffer text.
548 * Minibuffer Windows:: Operating on the special minibuffer windows.
549 * Recursive Mini:: Whether recursive entry to minibuffer is allowed.
550 * Minibuffer Misc:: Various customization hooks and variables.
554 * Basic Completion:: Low-level functions for completing strings.
555 (These are too low level to use the minibuffer.)
556 * Minibuffer Completion:: Invoking the minibuffer with completion.
557 * Completion Commands:: Minibuffer commands that do completion.
558 * High-Level Completion:: Convenient special cases of completion
559 (reading buffer name, file name, etc.)
560 * Reading File Names:: Using completion to read file names.
561 * Programmed Completion:: Finding the completions for a given file name.
565 * Command Overview:: How the command loop reads commands.
566 * Defining Commands:: Specifying how a function should read arguments.
567 * Interactive Call:: Calling a command, so that it will read arguments.
568 * Command Loop Info:: Variables set by the command loop for you to examine.
569 * Adjusting Point:: Adjustment of point after a command.
570 * Input Events:: What input looks like when you read it.
571 * Reading Input:: How to read input events from the keyboard or mouse.
572 * Special Events:: Events processed immediately and individually.
573 * Waiting:: Waiting for user input or elapsed time.
574 * Quitting:: How @kbd{C-g} works. How to catch or defer quitting.
575 * Prefix Command Arguments:: How the commands to set prefix args work.
576 * Recursive Editing:: Entering a recursive edit,
577 and why you usually shouldn't.
578 * Disabling Commands:: How the command loop handles disabled commands.
579 * Command History:: How the command history is set up, and how accessed.
580 * Keyboard Macros:: How keyboard macros are implemented.
584 * Using Interactive:: General rules for @code{interactive}.
585 * Interactive Codes:: The standard letter-codes for reading arguments
587 * Interactive Examples:: Examples of how to read interactive arguments.
591 * Keymap Terminology:: Definitions of terms pertaining to keymaps.
592 * Format of Keymaps:: What a keymap looks like as a Lisp object.
593 * Creating Keymaps:: Functions to create and copy keymaps.
594 * Inheritance and Keymaps:: How one keymap can inherit the bindings
596 * Prefix Keys:: Defining a key with a keymap as its definition.
597 * Active Keymaps:: Each buffer has a local keymap
598 to override the standard (global) bindings.
599 Each minor mode can also override them.
600 * Key Lookup:: How extracting elements from keymaps works.
601 * Functions for Key Lookup:: How to request key lookup.
602 * Changing Key Bindings:: Redefining a key in a keymap.
603 * Remapping Commands:: Bindings that translate one command to another.
604 * Key Binding Commands:: Interactive interfaces for redefining keys.
605 * Scanning Keymaps:: Looking through all keymaps, for printing help.
606 * Menu Keymaps:: A keymap can define a menu for X
607 or for use from the terminal.
609 Major and Minor Modes
611 * Hooks:: How to use hooks; how to write code that
613 * Major Modes:: Defining major modes.
614 * Minor Modes:: Defining minor modes.
615 * Mode Line Format:: Customizing the text that appears in the mode line.
616 * Imenu:: How a mode can provide a menu
617 of definitions in the buffer.
618 * Font Lock Mode:: How modes can highlight text according to syntax.
619 * Desktop Save Mode:: How modes can have buffer state saved between
624 * Major Mode Basics::
625 * Major Mode Conventions:: Coding conventions for keymaps, etc.
626 * Example Major Modes:: Text mode and Lisp modes.
627 * Auto Major Mode:: How Emacs chooses the major mode automatically.
628 * Mode Help:: Finding out how to use a mode.
629 * Derived Modes:: Defining a new major mode based on another major
631 * Generic Modes:: Defining a simple major mode that supports
632 comment syntax and Font Lock mode.
633 * Mode Hooks:: Hooks run at the end of major mode functions.
637 * Minor Mode Conventions:: Tips for writing a minor mode.
638 * Keymaps and Minor Modes:: How a minor mode can have its own keymap.
639 * Defining Minor Modes:: A convenient facility for defining minor modes.
644 * Mode Line Data:: The data structure that controls the mode line.
645 * Mode Line Variables:: Variables used in that data structure.
646 * %-Constructs:: Putting information into a mode line.
647 * Properties in Mode:: Using text properties in the mode line.
648 * Header Lines:: Like a mode line, but at the top.
649 * Emulating Mode Line:: Formatting text as the mode line would.
653 * Documentation Basics:: Good style for doc strings.
654 Where to put them. How Emacs stores them.
655 * Accessing Documentation:: How Lisp programs can access doc strings.
656 * Keys in Documentation:: Substituting current key bindings.
657 * Describing Characters:: Making printable descriptions of
658 non-printing characters and key sequences.
659 * Help Functions:: Subroutines used by Emacs help facilities.
663 * Visiting Files:: Reading files into Emacs buffers for editing.
664 * Saving Buffers:: Writing changed buffers back into files.
665 * Reading from Files:: Reading files into other buffers.
666 * Writing to Files:: Writing new files from parts of buffers.
667 * File Locks:: Locking and unlocking files, to prevent
668 simultaneous editing by two people.
669 * Information about Files:: Testing existence, accessibility, size of files.
670 * Changing Files:: Renaming files, changing protection, etc.
671 * File Names:: Decomposing and expanding file names.
672 * Contents of Directories:: Getting a list of the files in a directory.
673 * Create/Delete Dirs:: Creating and Deleting Directories.
674 * Magic File Names:: Defining "magic" special handling
675 for certain file names.
676 * Format Conversion:: Conversion to and from various file formats.
680 * Visiting Functions:: The usual interface functions for visiting.
681 * Subroutines of Visiting:: Lower-level subroutines that they use.
683 Information about Files
685 * Testing Accessibility:: Is a given file readable? Writable?
686 * Kinds of Files:: Is it a directory? A symbolic link?
687 * Truenames:: Eliminating symbolic links from a file name.
688 * File Attributes:: How large is it? Any other names? Etc.
692 * File Name Components:: The directory part of a file name, and the rest.
693 * Relative File Names:: Some file names are relative to a
695 * Directory Names:: A directory's name as a directory
696 is different from its name as a file.
697 * File Name Expansion:: Converting relative file names to absolute ones.
698 * Unique File Names:: Generating names for temporary files.
699 * File Name Completion:: Finding the completions for a given file name.
700 * Standard File Names:: If your package uses a fixed file name,
701 how to handle various operating systems simply.
703 Backups and Auto-Saving
705 * Backup Files:: How backup files are made; how their names
707 * Auto-Saving:: How auto-save files are made; how their
709 * Reverting:: @code{revert-buffer}, and how to customize
714 * Making Backups:: How Emacs makes backup files, and when.
715 * Rename or Copy:: Two alternatives: renaming the old file
717 * Numbered Backups:: Keeping multiple backups for each source file.
718 * Backup Names:: How backup file names are computed; customization.
722 * Buffer Basics:: What is a buffer?
723 * Current Buffer:: Designating a buffer as current
724 so primitives will access its contents.
725 * Buffer Names:: Accessing and changing buffer names.
726 * Buffer File Name:: The buffer file name indicates which file
728 * Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
729 * Modification Time:: Determining whether the visited file was changed
730 ``behind Emacs's back''.
731 * Read Only Buffers:: Modifying text is not allowed in a
733 * The Buffer List:: How to look at all the existing buffers.
734 * Creating Buffers:: Functions that create buffers.
735 * Killing Buffers:: Buffers exist until explicitly killed.
736 * Indirect Buffers:: An indirect buffer shares text with some
738 * Buffer Gap:: The gap in the buffer.
742 * Basic Windows:: Basic information on using windows.
743 * Splitting Windows:: Splitting one window into two windows.
744 * Deleting Windows:: Deleting a window gives its space to other windows.
745 * Selecting Windows:: The selected window is the one that you edit in.
746 * Cyclic Window Ordering:: Moving around the existing windows.
747 * Buffers and Windows:: Each window displays the contents of a buffer.
748 * Displaying Buffers:: Higher-lever functions for displaying a buffer
749 and choosing a window for it.
750 * Choosing Window:: How to choose a window for displaying a buffer.
751 * Window Point:: Each window has its own location of point.
752 * Window Start:: The display-start position controls which text
753 is on-screen in the window.
754 * Textual Scrolling:: Moving text up and down through the window.
755 * Vertical Scrolling:: Moving the contents up and down on the window.
756 * Horizontal Scrolling:: Moving the contents sideways on the window.
757 * Size of Window:: Accessing the size of a window.
758 * Resizing Windows:: Changing the size of a window.
759 * Coordinates and Windows:: Converting coordinates to windows.
760 * Window Configurations:: Saving and restoring the state of the screen.
761 * Window Hooks:: Hooks for scrolling, window size changes,
762 redisplay going past a certain point,
763 or window configuration changes.
767 * Creating Frames:: Creating additional frames.
768 * Multiple Displays:: Creating frames on other X displays.
769 * Frame Parameters:: Controlling frame size, position, font, etc.
770 * Frame Titles:: Automatic updating of frame titles.
771 * Deleting Frames:: Frames last until explicitly deleted.
772 * Finding All Frames:: How to examine all existing frames.
773 * Frames and Windows:: A frame contains windows;
774 display of text always works through windows.
775 * Minibuffers and Frames:: How a frame finds the minibuffer to use.
776 * Input Focus:: Specifying the selected frame.
777 * Visibility of Frames:: Frames may be visible or invisible, or icons.
778 * Raising and Lowering:: Raising a frame makes it hide other X windows;
779 lowering it puts it underneath the others.
780 * Frame Configurations:: Saving the state of all frames.
781 * Mouse Tracking:: Getting events that say when the mouse moves.
782 * Mouse Position:: Asking where the mouse is, or moving it.
783 * Pop-Up Menus:: Displaying a menu for the user to select from.
784 * Dialog Boxes:: Displaying a box to ask yes or no.
785 * Pointer Shapes:: Specifying the shape of the mouse pointer.
786 * Window System Selections::Transferring text to and from other windows.
787 * Color Names:: Getting the definitions of color names.
788 * Text Terminal Colors:: Defining colors for text-only terminals.
789 * Resources:: Getting resource values from the server.
790 * Display Feature Testing:: Determining the features of a terminal.
794 * Point:: The special position where editing takes place.
795 * Motion:: Changing point.
796 * Excursions:: Temporary motion and buffer changes.
797 * Narrowing:: Restricting editing to a portion of the buffer.
801 * Character Motion:: Moving in terms of characters.
802 * Word Motion:: Moving in terms of words.
803 * Buffer End Motion:: Moving to the beginning or end of the buffer.
804 * Text Lines:: Moving in terms of lines of text.
805 * Screen Lines:: Moving in terms of lines as displayed.
806 * List Motion:: Moving by parsing lists and sexps.
807 * Skipping Characters:: Skipping characters belonging to a certain set.
811 * Overview of Markers:: The components of a marker, and how it relocates.
812 * Predicates on Markers:: Testing whether an object is a marker.
813 * Creating Markers:: Making empty markers or markers at certain places.
814 * Information from Markers::Finding the marker's buffer or character
816 * Marker Insertion Types:: Two ways a marker can relocate when you
817 insert where it points.
818 * Moving Markers:: Moving the marker to a new buffer or position.
819 * The Mark:: How ``the mark'' is implemented with a marker.
820 * The Region:: How to access ``the region''.
824 * Near Point:: Examining text in the vicinity of point.
825 * Buffer Contents:: Examining text in a general fashion.
826 * Comparing Text:: Comparing substrings of buffers.
827 * Insertion:: Adding new text to a buffer.
828 * Commands for Insertion:: User-level commands to insert text.
829 * Deletion:: Removing text from a buffer.
830 * User-Level Deletion:: User-level commands to delete text.
831 * The Kill Ring:: Where removed text sometimes is saved for
833 * Undo:: Undoing changes to the text of a buffer.
834 * Maintaining Undo:: How to enable and disable undo information.
835 How to control how much information is kept.
836 * Filling:: Functions for explicit filling.
837 * Margins:: How to specify margins for filling commands.
838 * Adaptive Fill:: Adaptive Fill mode chooses a fill prefix
840 * Auto Filling:: How auto-fill mode is implemented to break lines.
841 * Sorting:: Functions for sorting parts of the buffer.
842 * Columns:: Computing horizontal positions, and using them.
843 * Indentation:: Functions to insert or adjust indentation.
844 * Case Changes:: Case conversion of parts of the buffer.
845 * Text Properties:: Assigning Lisp property lists to text characters.
846 * Substitution:: Replacing a given character wherever it appears.
847 * Transposition:: Swapping two portions of a buffer.
848 * Registers:: How registers are implemented. Accessing
849 the text or position stored in a register.
850 * Base 64:: Conversion to or from base 64 encoding.
851 * MD5 Checksum:: Compute the MD5 ``message digest''/``checksum''.
852 * Atomic Changes:: Installing several buffer changes ``atomically''.
853 * Change Hooks:: Supplying functions to be run when text is changed.
857 * Kill Ring Concepts:: What text looks like in the kill ring.
858 * Kill Functions:: Functions that kill text.
859 * Yanking:: How yanking is done.
860 * Yank Commands:: Commands that access the kill ring.
861 * Low-Level Kill Ring:: Functions and variables for kill ring access.
862 * Internals of Kill Ring:: Variables that hold kill-ring data.
866 * Primitive Indent:: Functions used to count and insert indentation.
867 * Mode-Specific Indent:: Customize indentation for different modes.
868 * Region Indent:: Indent all the lines in a region.
869 * Relative Indent:: Indent the current line based on previous lines.
870 * Indent Tabs:: Adjustable, typewriter-like tab stops.
871 * Motion by Indent:: Move to first non-blank character.
875 * Examining Properties:: Looking at the properties of one character.
876 * Changing Properties:: Setting the properties of a range of text.
877 * Property Search:: Searching for where a property changes value.
878 * Special Properties:: Particular properties with special meanings.
879 * Format Properties:: Properties for representing formatting of text.
880 * Sticky Properties:: How inserted text gets properties from
882 * Saving Properties:: Saving text properties in files, and reading
884 * Lazy Properties:: Computing text properties in a lazy fashion
885 only when text is examined.
886 * Clickable Text:: Using text properties to make regions of text
887 do something when you click on them.
888 * Links and Mouse-1:: How to make @key{Mouse-1} follow a link.
889 * Fields:: The @code{field} property defines
890 fields within the buffer.
891 * Not Intervals:: Why text properties do not use
892 Lisp-visible text intervals.
896 * Text Representations:: Unibyte and multibyte representations
897 * Converting Representations:: Converting unibyte to multibyte and vice versa.
898 * Selecting a Representation:: Treating a byte sequence as unibyte or multi.
899 * Character Codes:: How unibyte and multibyte relate to
900 codes of individual characters.
901 * Character Sets:: The space of possible characters codes
902 is divided into various character sets.
903 * Chars and Bytes:: More information about multibyte encodings.
904 * Splitting Characters:: Converting a character to its byte sequence.
905 * Scanning Charsets:: Which character sets are used in a buffer?
906 * Translation of Characters:: Translation tables are used for conversion.
907 * Coding Systems:: Coding systems are conversions for saving files.
908 * Input Methods:: Input methods allow users to enter various
909 non-ASCII characters without special keyboards.
910 * Locales:: Interacting with the POSIX locale.
912 Searching and Matching
914 * String Search:: Search for an exact match.
915 * Searching and Case:: Case-independent or case-significant searching.
916 * Regular Expressions:: Describing classes of strings.
917 * Regexp Search:: Searching for a match for a regexp.
918 * POSIX Regexps:: Searching POSIX-style for the longest match.
919 * Match Data:: Finding out which part of the text matched,
920 after a string or regexp search.
921 * Search and Replace:: Commands that loop, searching and replacing.
922 * Standard Regexps:: Useful regexps for finding sentences, pages,...
926 * Syntax of Regexps:: Rules for writing regular expressions.
927 * Regexp Example:: Illustrates regular expression syntax.
928 * Regexp Functions:: Functions for operating on regular expressions.
932 * Syntax Basics:: Basic concepts of syntax tables.
933 * Syntax Descriptors:: How characters are classified.
934 * Syntax Table Functions:: How to create, examine and alter syntax tables.
935 * Syntax Properties:: Overriding syntax with text properties.
936 * Motion and Syntax:: Moving over characters with certain syntaxes.
937 * Parsing Expressions:: Parsing balanced expressions
938 using the syntax table.
939 * Standard Syntax Tables:: Syntax tables used by various major modes.
940 * Syntax Table Internals:: How syntax table information is stored.
941 * Categories:: Another way of classifying character syntax.
945 * Syntax Class Table:: Table of syntax classes.
946 * Syntax Flags:: Additional flags each character can have.
948 Abbrevs And Abbrev Expansion
950 * Abbrev Mode:: Setting up Emacs for abbreviation.
951 * Abbrev Tables:: Creating and working with abbrev tables.
952 * Defining Abbrevs:: Specifying abbreviations and their expansions.
953 * Abbrev Files:: Saving abbrevs in files.
954 * Abbrev Expansion:: Controlling expansion; expansion subroutines.
955 * Standard Abbrev Tables:: Abbrev tables used by various major modes.
959 * Subprocess Creation:: Functions that start subprocesses.
960 * Shell Arguments:: Quoting an argument to pass it to a shell.
961 * Synchronous Processes:: Details of using synchronous subprocesses.
962 * Asynchronous Processes:: Starting up an asynchronous subprocess.
963 * Deleting Processes:: Eliminating an asynchronous subprocess.
964 * Process Information:: Accessing run-status and other attributes.
965 * Input to Processes:: Sending input to an asynchronous subprocess.
966 * Signals to Processes:: Stopping, continuing or interrupting
967 an asynchronous subprocess.
968 * Output from Processes:: Collecting output from an asynchronous subprocess.
969 * Sentinels:: Sentinels run when process run-status changes.
970 * Query Before Exit:: Whether to query if exiting will kill a process.
971 * Transaction Queues:: Transaction-based communication with subprocesses.
972 * Network:: Opening network connections.
973 * Network Servers:: Network servers let Emacs accept net connections.
974 * Datagrams:: UDP network connections.
975 * Low-Level Network:: Lower-level but more general function
976 to create connections and servers.
977 * Misc Network:: Additional relevant functions for network connections.
978 * Byte Packing:: Using bindat to pack and unpack binary data.
980 Receiving Output from Processes
982 * Process Buffers:: If no filter, output is put in a buffer.
983 * Filter Functions:: Filter functions accept output from the process.
984 * Decoding Output:: Filters can get unibyte or multibyte strings.
985 * Accepting Output:: How to wait until process output arrives.
989 * Refresh Screen:: Clearing the screen and redrawing everything on it.
990 * Forcing Redisplay:: Forcing redisplay.
991 * Truncation:: Folding or wrapping long text lines.
992 * The Echo Area:: Displaying messages at the bottom of the screen.
993 * Warnings:: Displaying warning messages for the user.
994 * Invisible Text:: Hiding part of the buffer text.
995 * Selective Display:: Hiding part of the buffer text (the old way).
996 * Temporary Displays:: Displays that go away automatically.
997 * Overlays:: Use overlays to highlight parts of the buffer.
998 * Width:: How wide a character or string is on the screen.
999 * Line Height:: Controlling the height of lines.
1000 * Faces:: A face defines a graphics style
1001 for text characters: font, colors, etc.
1002 * Fringes:: Controlling window fringes.
1003 * Scroll Bars:: Controlling vertical scroll bars.
1004 * Pointer Shape:: Controlling the mouse pointer shape.
1005 * Display Property:: Enabling special display features.
1006 * Images:: Displaying images in Emacs buffers.
1007 * Buttons:: Adding clickable buttons to Emacs buffers.
1008 * Blinking:: How Emacs shows the matching open parenthesis.
1009 * Usual Display:: The usual conventions for displaying nonprinting chars.
1010 * Display Tables:: How to specify other conventions.
1011 * Beeping:: Audible signal to the user.
1012 * Window Systems:: Which window system is being used.
1014 Operating System Interface
1016 * Starting Up:: Customizing Emacs start-up processing.
1017 * Getting Out:: How exiting works (permanent or temporary).
1018 * System Environment:: Distinguish the name and kind of system.
1019 * User Identification:: Finding the name and user id of the user.
1020 * Time of Day:: Getting the current time.
1021 * Time Conversion:: Converting a time from numeric form to a string, or
1022 to calendrical data (or vice versa).
1023 * Time Parsing:: Converting a time from numeric form to text
1025 * Processor Run Time:: Getting the run time used by Emacs.
1026 * Time Calculations:: Adding, subtracting, comparing times, etc.
1027 * Timers:: Setting a timer to call a function at a certain time.
1028 * Terminal Input:: Recording terminal input for debugging.
1029 * Terminal Output:: Recording terminal output for debugging.
1030 * Sound Output:: Playing sounds on the computer's speaker.
1031 * X11 Keysyms:: Operating on key symbols for X Windows
1032 * Batch Mode:: Running Emacs without terminal interaction.
1033 * Session Management:: Saving and restoring state with X Session Management.
1037 * Startup Summary:: Sequence of actions Emacs performs at start-up.
1038 * Init File:: Details on reading the init file (@file{.emacs}).
1039 * Terminal-Specific:: How the terminal-specific Lisp file is read.
1040 * Command-Line Arguments:: How command line arguments are processed,
1041 and how you can customize them.
1043 Getting out of Emacs
1045 * Killing Emacs:: Exiting Emacs irreversibly.
1046 * Suspending Emacs:: Exiting Emacs reversibly.
1048 Tips and Conventions
1050 * Coding Conventions:: Conventions for clean and robust programs.
1051 * Key Binding Conventions:: Which keys should be bound by which programs.
1052 * Programming Tips:: Making Emacs code fit smoothly in Emacs.
1053 * Compilation Tips:: Making compiled code run fast.
1054 * Warning Tips:: Turning off compiler warnings.
1055 * Documentation Tips:: Writing readable documentation strings.
1056 * Comment Tips:: Conventions for writing comments.
1057 * Library Headers:: Standard headers for library packages.
1061 * Building Emacs:: How to preload Lisp libraries into Emacs.
1062 * Pure Storage:: A kludge to make preloaded Lisp functions sharable.
1063 * Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1064 * Memory Usage:: Info about total size of Lisp objects made so far.
1065 * Writing Emacs Primitives:: Writing C code for Emacs.
1066 * Object Internals:: Data formats of buffers, windows, processes.
1070 * Buffer Internals:: Components of a buffer structure.
1071 * Window Internals:: Components of a window structure.
1072 * Process Internals:: Components of a process structure.
1076 @include objects.texi
1077 @include numbers.texi
1078 @include strings.texi
1081 @include sequences.texi
1083 @include symbols.texi
1086 @include control.texi
1087 @include variables.texi
1088 @include functions.texi
1089 @include macros.texi
1091 @include customize.texi
1092 @include loading.texi
1093 @include compile.texi
1094 @include advice.texi
1096 @include debugging.texi
1097 @include streams.texi
1098 @include minibuf.texi
1099 @include commands.texi
1101 @include keymaps.texi
1106 @include backups.texi
1107 @include buffers.texi
1108 @include windows.texi
1109 @include frames.texi
1111 @include positions.texi
1112 @include markers.texi
1114 @include nonascii.texi
1116 @include searching.texi
1117 @include syntax.texi
1118 @include abbrevs.texi
1119 @include processes.texi
1121 @include display.texi
1124 @c MOVE to Emacs Manual: include misc-modes.texi
1128 @c REMOVE this: include non-hacker.texi
1131 @include doclicense.texi
1134 @include internals.texi
1135 @include errors.texi
1136 @include locals.texi
1142 @node New Symbols, , Index, Top
1143 @unnumbered New Symbols Since the Previous Edition
1150 These words prevent "local variables" above from confusing Emacs.
1153 arch-tag: f7e9a219-a0e1-4776-b631-08eaa1d49b34