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