Add support for auto-generating info/dir
[bpt/emacs.git] / doc / lispref / elisp.texi
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename elisp
4
5 @ifset VOL1
6 @set volflag
7 @set voltitle Volume 1
8 @end ifset
9
10 @ifset VOL2
11 @set volflag
12 @set voltitle Volume 2
13 @end ifset
14
15 @ifset volflag
16 @settitle GNU Emacs Lisp Reference Manual: @value{voltitle}
17 @end ifset
18 @ifclear volflag
19 @settitle GNU Emacs Lisp Reference Manual
20 @end ifclear
21
22 @c %**end of header
23
24 @c See two-volume-cross-refs.txt.
25 @tex
26 @ifset VOL1
27 \message{Formatting for two volume edition...Volume 1...}
28 %
29 % Read special toc file, set up in two-volume.make.
30 \gdef\tocreadfilename{elisp1-toc-ready.toc}
31 %
32 % Don't make outlines, they're not needed and \readdatafile can't pay
33 % attention to the special definition above.
34 \global\let\pdfmakeoutlines=\relax
35 %
36 % Start volume 1 chapter numbering at 1; this must be listed as chapno0.
37 \global\chapno=0
38 @end ifset
39 @ifset VOL2
40 \message{Formatting for two volume edition...Volume 2...}
41 %
42 % Read special toc file, set up in two-volume.make.
43 \gdef\tocreadfilename{elisp2-toc-ready.toc}
44 %
45 % Don't make outlines, they're not needed and \readdatafile can't pay
46 % attention to the special definition above.
47 \global\let\pdfmakeoutlines=\relax
48 %
49 % Start volume 2 chapter numbering at 27; this must be listed as chapno26
50 \global\chapno=26
51 @end ifset
52 @end tex
53
54
55 @c Version of the manual and of Emacs.
56 @c (See comments for EDITION in emacs.texi)
57 @set VERSION 3.1
58 @include emacsver.texi
59 @set DATE January 2013
60
61 @c in general, keep the following line commented out, unless doing a
62 @c copy of this manual that will be published. The manual should go
63 @c onto the distribution in the full, 8.5 x 11" size.
64 @c @set smallbook
65
66 @ifset volflag
67 @smallbook
68 @end ifset
69
70 @ifset smallbook
71 @smallbook
72 @end ifset
73
74 @c per rms and peterb, use 10pt fonts for the main text, mostly to
75 @c save on paper cost.
76 @c Do this inside @tex for now, so current makeinfo does not complain.
77 @tex
78 @ifset smallbook
79 @fonttextsize 10
80 @end ifset
81 \global\hbadness=6666 % don't worry about not-too-underfull boxes
82 @end tex
83
84 @c Combine indices.
85 @synindex cp fn
86 @syncodeindex vr fn
87 @syncodeindex ky fn
88 @syncodeindex pg fn
89 @c We use the "type index" to index new functions and variables.
90 @c @syncodeindex tp fn
91
92 @copying
93 @iftex
94 This is edition @value{VERSION} of the @cite{GNU Emacs Lisp Reference Manual},@*
95 @end iftex
96 @ifnottex
97 This is the @cite{GNU Emacs Lisp Reference Manual}
98 @end ifnottex
99 corresponding to Emacs version @value{EMACSVER}.
100
101 Copyright @copyright{} 1990--1996, 1998--2013 Free Software Foundation, Inc.
102
103 @quotation
104 Permission is granted to copy, distribute and/or modify this document
105 under the terms of the GNU Free Documentation License, Version 1.3 or
106 any later version published by the Free Software Foundation; with the
107 Invariant Sections being ``GNU General Public License,'' with the
108 Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
109 Texts as in (a) below. A copy of the license is included in the
110 section entitled ``GNU Free Documentation License.''
111
112 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
113 modify this GNU manual. Buying copies from the FSF supports it in
114 developing GNU and promoting software freedom.''
115 @end quotation
116 @end copying
117
118 @documentencoding UTF-8
119
120 @dircategory GNU Emacs Lisp
121 @direntry
122 * Elisp: (elisp). The Emacs Lisp Reference Manual.
123 @end direntry
124
125 @titlepage
126 @title GNU Emacs Lisp Reference Manual
127 @ifset volflag
128 @subtitle @value{voltitle}
129 @end ifset
130 @subtitle For Emacs Version @value{EMACSVER}
131 @subtitle Revision @value{VERSION}, @value{DATE}
132
133 @author by Bil Lewis, Dan LaLiberte, Richard Stallman,
134 @author the GNU Manual Group, et al.
135 @page
136 @vskip 0pt plus 1filll
137 @insertcopying
138
139 @sp 2
140 Published by the Free Software Foundation @*
141 51 Franklin St, Fifth Floor @*
142 Boston, MA 02110-1301 @*
143 USA @*
144 ISBN 1-882114-74-4
145
146 @sp 2
147 Cover art by Etienne Suvasa.
148 @end titlepage
149
150
151 @c Print the tables of contents
152 @summarycontents
153 @contents
154
155
156 @ifnottex
157 @node Top
158 @top Emacs Lisp
159
160 @ifset WWW_GNU_ORG
161 @html
162 <p>The homepage for GNU Emacs is at
163 <a href="/software/emacs/">http://www.gnu.org/software/emacs/</a>.<br>
164 For information on using Emacs, refer to the
165 <a href="/software/emacs/manual/emacs.html">Emacs Manual</a>.<br>
166 To view this manual in other formats, click
167 <a href="/software/emacs/manual/elisp.html">here</a>.
168 @end html
169 @end ifset
170
171 @insertcopying
172 @end ifnottex
173
174 @menu
175 * Introduction:: Introduction and conventions used.
176
177 * Lisp Data Types:: Data types of objects in Emacs Lisp.
178 * Numbers:: Numbers and arithmetic functions.
179 * Strings and Characters:: Strings, and functions that work on them.
180 * Lists:: Lists, cons cells, and related functions.
181 * Sequences Arrays Vectors:: Lists, strings and vectors are called sequences.
182 Certain functions act on any kind of sequence.
183 The description of vectors is here as well.
184 * Hash Tables:: Very fast lookup-tables.
185 * Symbols:: Symbols represent names, uniquely.
186
187 * Evaluation:: How Lisp expressions are evaluated.
188 * Control Structures:: Conditionals, loops, nonlocal exits.
189 * Variables:: Using symbols in programs to stand for values.
190 * Functions:: A function is a Lisp program
191 that can be invoked from other functions.
192 * Macros:: Macros are a way to extend the Lisp language.
193 * Customization:: Making variables and faces customizable.
194
195 * Loading:: Reading files of Lisp code into Lisp.
196 * Byte Compilation:: Compilation makes programs run faster.
197 * Advising Functions:: Adding to the definition of a function.
198 * Debugging:: Tools and tips for debugging Lisp programs.
199
200 * Read and Print:: Converting Lisp objects to text and back.
201 * Minibuffers:: Using the minibuffer to read input.
202 * Command Loop:: How the editor command loop works,
203 and how you can call its subroutines.
204 * Keymaps:: Defining the bindings from keys to commands.
205 * Modes:: Defining major and minor modes.
206 * Documentation:: Writing and using documentation strings.
207
208 * Files:: Accessing files.
209 * Backups and Auto-Saving:: Controlling how backups and auto-save
210 files are made.
211 * Buffers:: Creating and using buffer objects.
212 * Windows:: Manipulating windows and displaying buffers.
213 * Frames:: Making multiple system-level windows.
214 * Positions:: Buffer positions and motion functions.
215 * Markers:: Markers represent positions and update
216 automatically when the text is changed.
217
218 * Text:: Examining and changing text in buffers.
219 * Non-ASCII Characters:: Non-ASCII text in buffers and strings.
220 * Searching and Matching:: Searching buffers for strings or regexps.
221 * Syntax Tables:: The syntax table controls word and list parsing.
222 * Abbrevs:: How Abbrev mode works, and its data structures.
223
224 * Processes:: Running and communicating with subprocesses.
225 * Display:: Features for controlling the screen display.
226 * System Interface:: Getting the user id, system type, environment
227 variables, and other such things.
228
229 * Packaging:: Preparing Lisp code for distribution.
230
231 Appendices
232
233 * Antinews:: Info for users downgrading to Emacs 23.
234 * GNU Free Documentation License:: The license for this documentation.
235 * GPL:: Conditions for copying and changing GNU Emacs.
236 * Tips:: Advice and coding conventions for Emacs Lisp.
237 * GNU Emacs Internals:: Building and dumping Emacs;
238 internal data structures.
239 * Standard Errors:: List of some standard error symbols.
240 * Standard Keymaps:: List of some standard keymaps.
241 * Standard Hooks:: List of some standard hook variables.
242
243 * Index:: Index including concepts, functions, variables,
244 and other terms.
245
246 @ignore
247 * New Symbols:: New functions and variables in Emacs @value{EMACSVER}.
248 @end ignore
249
250 @c Do NOT modify the following 3 lines! They must have this form to
251 @c be correctly identified by `texinfo-multiple-files-update'. In
252 @c particular, the detailed menu header line MUST be identical to the
253 @c value of `texinfo-master-menu-header'. See texnfo-upd.el.
254
255 @detailmenu
256 --- The Detailed Node Listing ---
257 ---------------------------------
258
259 Here are other nodes that are subnodes of those already listed,
260 mentioned here so you can get to them in one step:
261
262 Introduction
263
264 * Caveats:: Flaws and a request for help.
265 * Lisp History:: Emacs Lisp is descended from Maclisp.
266 * Conventions:: How the manual is formatted.
267 * Version Info:: Which Emacs version is running?
268 * Acknowledgments:: The authors, editors, and sponsors of this manual.
269
270 Conventions
271
272 * Some Terms:: Explanation of terms we use in this manual.
273 * nil and t:: How the symbols @code{nil} and @code{t} are used.
274 * Evaluation Notation:: The format we use for examples of evaluation.
275 * Printing Notation:: The format we use when examples print text.
276 * Error Messages:: The format we use for examples of errors.
277 * Buffer Text Notation:: The format we use for buffer contents in examples.
278 * Format of Descriptions:: Notation for describing functions, variables, etc.
279
280 Format of Descriptions
281
282 * A Sample Function Description:: A description of an imaginary
283 function, @code{foo}.
284 * A Sample Variable Description:: A description of an imaginary
285 variable, @code{electric-future-map}.
286
287 Lisp Data Types
288
289 * Printed Representation:: How Lisp objects are represented as text.
290 * Comments:: Comments and their formatting conventions.
291 * Programming Types:: Types found in all Lisp systems.
292 * Editing Types:: Types specific to Emacs.
293 * Circular Objects:: Read syntax for circular structure.
294 * Type Predicates:: Tests related to types.
295 * Equality Predicates:: Tests of equality between any two objects.
296
297 Programming Types
298
299 * Integer Type:: Numbers without fractional parts.
300 * Floating Point Type:: Numbers with fractional parts and with a large range.
301 * Character Type:: The representation of letters, numbers and
302 control characters.
303 * Symbol Type:: A multi-use object that refers to a function,
304 variable, or property list, and has a unique identity.
305 * Sequence Type:: Both lists and arrays are classified as sequences.
306 * Cons Cell Type:: Cons cells, and lists (which are made from cons cells).
307 * Array Type:: Arrays include strings and vectors.
308 * String Type:: An (efficient) array of characters.
309 * Vector Type:: One-dimensional arrays.
310 * Char-Table Type:: One-dimensional sparse arrays indexed by characters.
311 * Bool-Vector Type:: One-dimensional arrays of @code{t} or @code{nil}.
312 * Hash Table Type:: Super-fast lookup tables.
313 * Function Type:: A piece of executable code you can call from elsewhere.
314 * Macro Type:: A method of expanding an expression into another
315 expression, more fundamental but less pretty.
316 * Primitive Function Type:: A function written in C, callable from Lisp.
317 * Byte-Code Type:: A function written in Lisp, then compiled.
318 * Autoload Type:: A type used for automatically loading seldom-used
319 functions.
320
321 Character Type
322
323 * Basic Char Syntax:: Syntax for regular characters.
324 * General Escape Syntax:: How to specify characters by their codes.
325 * Ctl-Char Syntax:: Syntax for control characters.
326 * Meta-Char Syntax:: Syntax for meta-characters.
327 * Other Char Bits:: Syntax for hyper-, super-, and alt-characters.
328
329 Cons Cell and List Types
330
331 * Box Diagrams:: Drawing pictures of lists.
332 * Dotted Pair Notation:: A general syntax for cons cells.
333 * Association List Type:: A specially constructed list.
334
335 String Type
336
337 * Syntax for Strings:: How to specify Lisp strings.
338 * Non-ASCII in Strings:: International characters in strings.
339 * Nonprinting Characters:: Literal unprintable characters in strings.
340 * Text Props and Strings:: Strings with text properties.
341
342 Editing Types
343
344 * Buffer Type:: The basic object of editing.
345 * Marker Type:: A position in a buffer.
346 * Window Type:: Buffers are displayed in windows.
347 * Frame Type:: Windows subdivide frames.
348 * Terminal Type:: A terminal device displays frames.
349 * Window Configuration Type:: Recording the way a frame is subdivided.
350 * Frame Configuration Type:: Recording the status of all frames.
351 * Process Type:: A subprocess of Emacs running on the underlying OS.
352 * Stream Type:: Receive or send characters.
353 * Keymap Type:: What function a keystroke invokes.
354 * Overlay Type:: How an overlay is represented.
355 * Font Type:: Fonts for displaying text.
356
357 Numbers
358
359 * Integer Basics:: Representation and range of integers.
360 * Float Basics:: Representation and range of floating point.
361 * Predicates on Numbers:: Testing for numbers.
362 * Comparison of Numbers:: Equality and inequality predicates.
363 * Numeric Conversions:: Converting float to integer and vice versa.
364 * Arithmetic Operations:: How to add, subtract, multiply and divide.
365 * Rounding Operations:: Explicitly rounding floating point numbers.
366 * Bitwise Operations:: Logical and, or, not, shifting.
367 * Math Functions:: Trig, exponential and logarithmic functions.
368 * Random Numbers:: Obtaining random integers, predictable or not.
369
370 Strings and Characters
371
372 * String Basics:: Basic properties of strings and characters.
373 * Predicates for Strings:: Testing whether an object is a string or char.
374 * Creating Strings:: Functions to allocate new strings.
375 * Modifying Strings:: Altering the contents of an existing string.
376 * Text Comparison:: Comparing characters or strings.
377 * String Conversion:: Converting to and from characters and strings.
378 * Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}.
379 * Case Conversion:: Case conversion functions.
380 * Case Tables:: Customizing case conversion.
381
382 Lists
383
384 * Cons Cells:: How lists are made out of cons cells.
385 * List-related Predicates:: Is this object a list? Comparing two lists.
386 * List Elements:: Extracting the pieces of a list.
387 * Building Lists:: Creating list structure.
388 * List Variables:: Modifying lists stored in variables.
389 * Modifying Lists:: Storing new pieces into an existing list.
390 * Sets And Lists:: A list can represent a finite mathematical set.
391 * Association Lists:: A list can represent a finite relation or mapping.
392 * Property Lists:: A list of paired elements.
393
394 Modifying Existing List Structure
395
396 * Setcar:: Replacing an element in a list.
397 * Setcdr:: Replacing part of the list backbone.
398 This can be used to remove or add elements.
399 * Rearrangement:: Reordering the elements in a list; combining lists.
400
401 Property Lists
402
403 * Plists and Alists:: Comparison of the advantages of property
404 lists and association lists.
405 * Plist Access:: Accessing property lists stored elsewhere.
406
407 Sequences, Arrays, and Vectors
408
409 * Sequence Functions:: Functions that accept any kind of sequence.
410 * Arrays:: Characteristics of arrays in Emacs Lisp.
411 * Array Functions:: Functions specifically for arrays.
412 * Vectors:: Special characteristics of Emacs Lisp vectors.
413 * Vector Functions:: Functions specifically for vectors.
414 * Char-Tables:: How to work with char-tables.
415 * Bool-Vectors:: How to work with bool-vectors.
416 * Rings:: Managing a fixed-size ring of objects.
417
418 Hash Tables
419
420 * Creating Hash:: Functions to create hash tables.
421 * Hash Access:: Reading and writing the hash table contents.
422 * Defining Hash:: Defining new comparison methods.
423 * Other Hash:: Miscellaneous.
424
425 Symbols
426
427 * Symbol Components:: Symbols have names, values, function definitions
428 and property lists.
429 * Definitions:: A definition says how a symbol will be used.
430 * Creating Symbols:: How symbols are kept unique.
431 * Symbol Properties:: Each symbol has a property list
432 for recording miscellaneous information.
433
434 Symbol Properties
435
436 * Symbol Plists:: Accessing symbol properties.
437 * Standard Properties:: Standard meanings of symbol properties.
438
439 Evaluation
440
441 * Intro Eval:: Evaluation in the scheme of things.
442 * Forms:: How various sorts of objects are evaluated.
443 * Quoting:: Avoiding evaluation (to put constants in
444 the program).
445 * Backquote:: Easier construction of list structure.
446 * Eval:: How to invoke the Lisp interpreter explicitly.
447
448 Kinds of Forms
449
450 * Self-Evaluating Forms:: Forms that evaluate to themselves.
451 * Symbol Forms:: Symbols evaluate as variables.
452 * Classifying Lists:: How to distinguish various sorts of list forms.
453 * Function Indirection:: When a symbol appears as the car of a list,
454 we find the real function via the symbol.
455 * Function Forms:: Forms that call functions.
456 * Macro Forms:: Forms that call macros.
457 * Special Forms:: "Special forms" are idiosyncratic primitives,
458 most of them extremely important.
459 * Autoloading:: Functions set up to load files
460 containing their real definitions.
461
462 Control Structures
463
464 * Sequencing:: Evaluation in textual order.
465 * Conditionals:: @code{if}, @code{cond}, @code{when}, @code{unless}.
466 * Combining Conditions:: @code{and}, @code{or}, @code{not}.
467 * Iteration:: @code{while} loops.
468 * Nonlocal Exits:: Jumping out of a sequence.
469
470 Nonlocal Exits
471
472 * Catch and Throw:: Nonlocal exits for the program's own purposes.
473 * Examples of Catch:: Showing how such nonlocal exits can be written.
474 * Errors:: How errors are signaled and handled.
475 * Cleanups:: Arranging to run a cleanup form if an
476 error happens.
477
478 Errors
479
480 * Signaling Errors:: How to report an error.
481 * Processing of Errors:: What Emacs does when you report an error.
482 * Handling Errors:: How you can trap errors and continue execution.
483 * Error Symbols:: How errors are classified for trapping them.
484
485 Variables
486
487 * Global Variables:: Variable values that exist permanently, everywhere.
488 * Constant Variables:: Certain "variables" have values that never change.
489 * Local Variables:: Variable values that exist only temporarily.
490 * Void Variables:: Symbols that lack values.
491 * Defining Variables:: A definition says a symbol is used as a variable.
492 * Tips for Defining:: Things you should think about when you
493 define a variable.
494 * Accessing Variables:: Examining values of variables whose names
495 are known only at run time.
496 * Setting Variables:: Storing new values in variables.
497 * Variable Scoping:: How Lisp chooses among local and global values.
498 * Buffer-Local Variables:: Variable values in effect only in one buffer.
499 * File Local Variables:: Handling local variable lists in files.
500 * Directory Local Variables:: Local variables common to all files in a
501 directory.
502 * Variable Aliases:: Variables that are aliases for other variables.
503 * Variables with Restricted Values:: Non-constant variables whose value can
504 @emph{not} be an arbitrary Lisp object.
505 * Generalized Variables:: Extending the concept of variables.
506
507 Scoping Rules for Variable Bindings
508
509 * Dynamic Binding:: The default for binding local variables in Emacs.
510 * Dynamic Binding Tips:: Avoiding problems with dynamic binding.
511 * Lexical Binding:: A different type of local variable binding.
512 * Using Lexical Binding:: How to enable lexical binding.
513
514 Buffer-Local Variables
515
516 * Intro to Buffer-Local:: Introduction and concepts.
517 * Creating Buffer-Local:: Creating and destroying buffer-local bindings.
518 * Default Value:: The default value is seen in buffers
519 that don't have their own buffer-local values.
520
521 Generalized Variables
522
523 * Setting Generalized Variables:: The @code{setf} macro.
524 * Adding Generalized Variables:: Defining new @code{setf} forms.
525
526 Functions
527
528 * What Is a Function:: Lisp functions vs. primitives; terminology.
529 * Lambda Expressions:: How functions are expressed as Lisp objects.
530 * Function Names:: A symbol can serve as the name of a function.
531 * Defining Functions:: Lisp expressions for defining functions.
532 * Calling Functions:: How to use an existing function.
533 * Mapping Functions:: Applying a function to each element of a list, etc.
534 * Anonymous Functions:: Lambda expressions are functions with no names.
535 * Function Cells:: Accessing or setting the function definition
536 of a symbol.
537 * Closures:: Functions that enclose a lexical environment.
538 * Obsolete Functions:: Declaring functions obsolete.
539 * Inline Functions:: Defining functions that the compiler
540 will expand inline.
541 * Declare Form:: Adding additional information about a function.
542 * Declaring Functions:: Telling the compiler that a function is defined.
543 * Function Safety:: Determining whether a function is safe to call.
544 * Related Topics:: Cross-references to specific Lisp primitives
545 that have a special bearing on how
546 functions work.
547
548 Lambda Expressions
549
550 * Lambda Components:: The parts of a lambda expression.
551 * Simple Lambda:: A simple example.
552 * Argument List:: Details and special features of argument lists.
553 * Function Documentation:: How to put documentation in a function.
554
555 Macros
556
557 * Simple Macro:: A basic example.
558 * Expansion:: How, when and why macros are expanded.
559 * Compiling Macros:: How macros are expanded by the compiler.
560 * Defining Macros:: How to write a macro definition.
561 * Problems with Macros:: Don't evaluate the macro arguments too many times.
562 Don't hide the user's variables.
563 * Indenting Macros:: Specifying how to indent macro calls.
564
565 Common Problems Using Macros
566
567 * Wrong Time:: Do the work in the expansion, not in the macro.
568 * Argument Evaluation:: The expansion should evaluate each macro arg once.
569 * Surprising Local Vars:: Local variable bindings in the expansion
570 require special care.
571 * Eval During Expansion:: Don't evaluate them; put them in the expansion.
572 * Repeated Expansion:: Avoid depending on how many times expansion is done.
573
574 Customization Settings
575
576 * Common Keywords:: Common keyword arguments for all kinds of
577 customization declarations.
578 * Group Definitions:: Writing customization group definitions.
579 * Variable Definitions:: Declaring user options.
580 * Customization Types:: Specifying the type of a user option.
581 * Applying Customizations:: Functions to apply customization settings.
582 * Custom Themes:: Writing Custom themes.
583
584 Customization Types
585
586 * Simple Types:: Simple customization types: sexp, integer, etc.
587 * Composite Types:: Build new types from other types or data.
588 * Splicing into Lists:: Splice elements into list with @code{:inline}.
589 * Type Keywords:: Keyword-argument pairs in a customization type.
590 * Defining New Types:: Give your type a name.
591
592 Loading
593
594 * How Programs Do Loading:: The @code{load} function and others.
595 * Load Suffixes:: Details about the suffixes that @code{load} tries.
596 * Library Search:: Finding a library to load.
597 * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files.
598 * Autoload:: Setting up a function to autoload.
599 * Repeated Loading:: Precautions about loading a file twice.
600 * Named Features:: Loading a library if it isn't already loaded.
601 * Where Defined:: Finding which file defined a certain symbol.
602 * Unloading:: How to "unload" a library that was loaded.
603 * Hooks for Loading:: Providing code to be run when
604 particular libraries are loaded.
605
606 Byte Compilation
607
608 * Speed of Byte-Code:: An example of speedup from byte compilation.
609 * Compilation Functions:: Byte compilation functions.
610 * Docs and Compilation:: Dynamic loading of documentation strings.
611 * Dynamic Loading:: Dynamic loading of individual functions.
612 * Eval During Compile:: Code to be evaluated when you compile.
613 * Compiler Errors:: Handling compiler error messages.
614 * Byte-Code Objects:: The data type used for byte-compiled functions.
615 * Disassembly:: Disassembling byte-code; how to read byte-code.
616
617 Advising Emacs Lisp Functions
618
619 * Simple Advice:: A simple example to explain the basics of advice.
620 * Defining Advice:: Detailed description of @code{defadvice}.
621 * Around-Advice:: Wrapping advice around a function's definition.
622 * Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
623 * Activation of Advice:: Advice doesn't do anything until you activate it.
624 * Enabling Advice:: You can enable or disable each piece of advice.
625 * Preactivation:: Preactivation is a way of speeding up the
626 loading of compiled advice.
627 * Argument Access in Advice:: How advice can access the function's arguments.
628 * Combined Definition:: How advice is implemented.
629
630 Debugging Lisp Programs
631
632 * Debugger:: A debugger for the Emacs Lisp evaluator.
633 * Edebug:: A source-level Emacs Lisp debugger.
634 * Syntax Errors:: How to find syntax errors.
635 * Test Coverage:: Ensuring you have tested all branches in your code.
636 * Profiling:: Measuring the resources that your code uses.
637
638 The Lisp Debugger
639
640 * Error Debugging:: Entering the debugger when an error happens.
641 * Infinite Loops:: Stopping and debugging a program that doesn't exit.
642 * Function Debugging:: Entering it when a certain function is called.
643 * Explicit Debug:: Entering it at a certain point in the program.
644 * Using Debugger:: What the debugger does; what you see while in it.
645 * Debugger Commands:: Commands used while in the debugger.
646 * Invoking the Debugger:: How to call the function @code{debug}.
647 * Internals of Debugger:: Subroutines of the debugger, and global variables.
648
649 Edebug
650
651 * Using Edebug:: Introduction to use of Edebug.
652 * Instrumenting:: You must instrument your code
653 in order to debug it with Edebug.
654 * Edebug Execution Modes:: Execution modes, stopping more or less often.
655 * Jumping:: Commands to jump to a specified place.
656 * Edebug Misc:: Miscellaneous commands.
657 * Breaks:: Setting breakpoints to make the program stop.
658 * Trapping Errors:: Trapping errors with Edebug.
659 * Edebug Views:: Views inside and outside of Edebug.
660 * Edebug Eval:: Evaluating expressions within Edebug.
661 * Eval List:: Expressions whose values are displayed
662 each time you enter Edebug.
663 * Printing in Edebug:: Customization of printing.
664 * Trace Buffer:: How to produce trace output in a buffer.
665 * Coverage Testing:: How to test evaluation coverage.
666 * The Outside Context:: Data that Edebug saves and restores.
667 * Edebug and Macros:: Specifying how to handle macro calls.
668 * Edebug Options:: Option variables for customizing Edebug.
669
670 Breaks
671
672 * Breakpoints:: Breakpoints at stop points.
673 * Global Break Condition:: Breaking on an event.
674 * Source Breakpoints:: Embedding breakpoints in source code.
675
676 The Outside Context
677
678 * Checking Whether to Stop::When Edebug decides what to do.
679 * Edebug Display Update:: When Edebug updates the display.
680 * Edebug Recursive Edit:: When Edebug stops execution.
681
682 Edebug and Macros
683
684 * Instrumenting Macro Calls::The basic problem.
685 * Specification List:: How to specify complex patterns of evaluation.
686 * Backtracking:: What Edebug does when matching fails.
687 * Specification Examples:: To help understand specifications.
688
689 Debugging Invalid Lisp Syntax
690
691 * Excess Open:: How to find a spurious open paren or missing close.
692 * Excess Close:: How to find a spurious close paren or missing open.
693
694 Reading and Printing Lisp Objects
695
696 * Streams Intro:: Overview of streams, reading and printing.
697 * Input Streams:: Various data types that can be used as
698 input streams.
699 * Input Functions:: Functions to read Lisp objects from text.
700 * Output Streams:: Various data types that can be used as
701 output streams.
702 * Output Functions:: Functions to print Lisp objects as text.
703 * Output Variables:: Variables that control what the printing
704 functions do.
705
706 Minibuffers
707
708 * Intro to Minibuffers:: Basic information about minibuffers.
709 * Text from Minibuffer:: How to read a straight text string.
710 * Object from Minibuffer:: How to read a Lisp object or expression.
711 * Minibuffer History:: Recording previous minibuffer inputs
712 so the user can reuse them.
713 * Initial Input:: Specifying initial contents for the minibuffer.
714 * Completion:: How to invoke and customize completion.
715 * Yes-or-No Queries:: Asking a question with a simple answer.
716 * Multiple Queries:: Asking a series of similar questions.
717 * Reading a Password:: Reading a password from the terminal.
718 * Minibuffer Commands:: Commands used as key bindings in minibuffers.
719 * Minibuffer Windows:: Operating on the special minibuffer windows.
720 * Minibuffer Contents:: How such commands access the minibuffer text.
721 * Recursive Mini:: Whether recursive entry to minibuffer is allowed.
722 * Minibuffer Misc:: Various customization hooks and variables.
723
724 Completion
725
726 * Basic Completion:: Low-level functions for completing strings.
727 * Minibuffer Completion:: Invoking the minibuffer with completion.
728 * Completion Commands:: Minibuffer commands that do completion.
729 * High-Level Completion:: Convenient special cases of completion
730 (reading buffer names, variable names, etc.).
731 * Reading File Names:: Using completion to read file names and
732 shell commands.
733 * Completion Variables:: Variables controlling completion behavior.
734 * Programmed Completion:: Writing your own completion function.
735 * Completion in Buffers:: Completing text in ordinary buffers.
736
737 Command Loop
738
739 * Command Overview:: How the command loop reads commands.
740 * Defining Commands:: Specifying how a function should read arguments.
741 * Interactive Call:: Calling a command, so that it will read arguments.
742 * Distinguish Interactive:: Making a command distinguish interactive calls.
743 * Command Loop Info:: Variables set by the command loop for you to examine.
744 * Adjusting Point:: Adjustment of point after a command.
745 * Input Events:: What input looks like when you read it.
746 * Reading Input:: How to read input events from the keyboard or mouse.
747 * Special Events:: Events processed immediately and individually.
748 * Waiting:: Waiting for user input or elapsed time.
749 * Quitting:: How @kbd{C-g} works. How to catch or defer quitting.
750 * Prefix Command Arguments:: How the commands to set prefix args work.
751 * Recursive Editing:: Entering a recursive edit,
752 and why you usually shouldn't.
753 * Disabling Commands:: How the command loop handles disabled commands.
754 * Command History:: How the command history is set up, and how accessed.
755 * Keyboard Macros:: How keyboard macros are implemented.
756
757 Defining Commands
758
759 * Using Interactive:: General rules for @code{interactive}.
760 * Interactive Codes:: The standard letter-codes for reading arguments
761 in various ways.
762 * Interactive Examples:: Examples of how to read interactive arguments.
763
764 Input Events
765
766 * Keyboard Events:: Ordinary characters--keys with symbols on them.
767 * Function Keys:: Function keys--keys with names, not symbols.
768 * Mouse Events:: Overview of mouse events.
769 * Click Events:: Pushing and releasing a mouse button.
770 * Drag Events:: Moving the mouse before releasing the button.
771 * Button-Down Events:: A button was pushed and not yet released.
772 * Repeat Events:: Double and triple click (or drag, or down).
773 * Motion Events:: Just moving the mouse, not pushing a button.
774 * Focus Events:: Moving the mouse between frames.
775 * Misc Events:: Other events the system can generate.
776 * Event Examples:: Examples of the lists for mouse events.
777 * Classifying Events:: Finding the modifier keys in an event symbol.
778 Event types.
779 * Accessing Mouse:: Functions to extract info from mouse events.
780 * Accessing Scroll:: Functions to get info from scroll bar events.
781 * Strings of Events:: Special considerations for putting
782 keyboard character events in a string.
783
784 Reading Input
785
786 * Key Sequence Input:: How to read one key sequence.
787 * Reading One Event:: How to read just one event.
788 * Event Mod:: How Emacs modifies events as they are read.
789 * Invoking the Input Method:: How reading an event uses the input method.
790 * Quoted Character Input:: Asking the user to specify a character.
791 * Event Input Misc:: How to reread or throw away input events.
792
793 Keymaps
794
795 * Key Sequences:: Key sequences as Lisp objects.
796 * Keymap Basics:: Basic concepts of keymaps.
797 * Format of Keymaps:: What a keymap looks like as a Lisp object.
798 * Creating Keymaps:: Functions to create and copy keymaps.
799 * Inheritance and Keymaps:: How one keymap can inherit the bindings
800 of another keymap.
801 * Prefix Keys:: Defining a key with a keymap as its definition.
802 * Active Keymaps:: How Emacs searches the active keymaps
803 for a key binding.
804 * Searching Keymaps:: A pseudo-Lisp summary of searching active maps.
805 * Controlling Active Maps:: Each buffer has a local keymap
806 to override the standard (global) bindings.
807 A minor mode can also override them.
808 * Key Lookup:: Finding a key's binding in one keymap.
809 * Functions for Key Lookup:: How to request key lookup.
810 * Changing Key Bindings:: Redefining a key in a keymap.
811 * Remapping Commands:: A keymap can translate one command to another.
812 * Translation Keymaps:: Keymaps for translating sequences of events.
813 * Key Binding Commands:: Interactive interfaces for redefining keys.
814 * Scanning Keymaps:: Looking through all keymaps, for printing help.
815 * Menu Keymaps:: Defining a menu as a keymap.
816
817 Menu Keymaps
818
819 * Defining Menus:: How to make a keymap that defines a menu.
820 * Mouse Menus:: How users actuate the menu with the mouse.
821 * Keyboard Menus:: How users actuate the menu with the keyboard.
822 * Menu Example:: Making a simple menu.
823 * Menu Bar:: How to customize the menu bar.
824 * Tool Bar:: A tool bar is a row of images.
825 * Modifying Menus:: How to add new items to a menu.
826 * Easy Menu:: A convenience macro for defining menus.
827
828 Defining Menus
829
830 * Simple Menu Items:: A simple kind of menu key binding.
831 * Extended Menu Items:: More complex menu item definitions.
832 * Menu Separators:: Drawing a horizontal line through a menu.
833 * Alias Menu Items:: Using command aliases in menu items.
834
835 Major and Minor Modes
836
837 * Hooks:: How to use hooks; how to write code that provides hooks.
838 * Major Modes:: Defining major modes.
839 * Minor Modes:: Defining minor modes.
840 * Mode Line Format:: Customizing the text that appears in the mode line.
841 * Imenu:: Providing a menu of definitions made in a buffer.
842 * Font Lock Mode:: How modes can highlight text according to syntax.
843 * Auto-Indentation:: How to teach Emacs to indent for a major mode.
844 * Desktop Save Mode:: How modes can have buffer state saved between
845 Emacs sessions.
846
847 Hooks
848
849 * Running Hooks:: How to run a hook.
850 * Setting Hooks:: How to put functions on a hook, or remove them.
851
852 Major Modes
853
854 * Major Mode Conventions:: Coding conventions for keymaps, etc.
855 * Auto Major Mode:: How Emacs chooses the major mode automatically.
856 * Mode Help:: Finding out how to use a mode.
857 * Derived Modes:: Defining a new major mode based on another major
858 mode.
859 * Basic Major Modes:: Modes that other modes are often derived from.
860 * Mode Hooks:: Hooks run at the end of major mode functions.
861 * Tabulated List Mode:: Parent mode for buffers containing tabulated data.
862 * Generic Modes:: Defining a simple major mode that supports
863 comment syntax and Font Lock mode.
864 * Example Major Modes:: Text mode and Lisp modes.
865
866 Minor Modes
867
868 * Minor Mode Conventions:: Tips for writing a minor mode.
869 * Keymaps and Minor Modes:: How a minor mode can have its own keymap.
870 * Defining Minor Modes:: A convenient facility for defining minor modes.
871
872 Mode Line Format
873
874 * Mode Line Basics:: Basic ideas of mode line control.
875 * Mode Line Data:: The data structure that controls the mode line.
876 * Mode Line Top:: The top level variable, mode-line-format.
877 * Mode Line Variables:: Variables used in that data structure.
878 * %-Constructs:: Putting information into a mode line.
879 * Properties in Mode:: Using text properties in the mode line.
880 * Header Lines:: Like a mode line, but at the top.
881 * Emulating Mode Line:: Formatting text as the mode line would.
882
883 Font Lock Mode
884
885 * Font Lock Basics:: Overview of customizing Font Lock.
886 * Search-based Fontification:: Fontification based on regexps.
887 * Customizing Keywords:: Customizing search-based fontification.
888 * Other Font Lock Variables:: Additional customization facilities.
889 * Levels of Font Lock:: Each mode can define alternative levels
890 so that the user can select more or less.
891 * Precalculated Fontification:: How Lisp programs that produce the buffer
892 contents can also specify how to fontify it.
893 * Faces for Font Lock:: Special faces specifically for Font Lock.
894 * Syntactic Font Lock:: Fontification based on syntax tables.
895 * Multiline Font Lock:: How to coerce Font Lock into properly
896 highlighting multiline constructs.
897
898 Multiline Font Lock Constructs
899
900 * Font Lock Multiline:: Marking multiline chunks with a text property.
901 * Region to Refontify:: Controlling which region gets refontified
902 after a buffer change.
903
904 Automatic Indentation of code
905
906 * SMIE:: A simple minded indentation engine.
907
908 Simple Minded Indentation Engine
909
910 * SMIE setup:: SMIE setup and features.
911 * Operator Precedence Grammars:: A very simple parsing technique.
912 * SMIE Grammar:: Defining the grammar of a language.
913 * SMIE Lexer:: Defining tokens.
914 * SMIE Tricks:: Working around the parser's limitations.
915 * SMIE Indentation:: Specifying indentation rules.
916 * SMIE Indentation Helpers:: Helper functions for indentation rules.
917 * SMIE Indentation Example:: Sample indentation rules.
918
919 Documentation
920
921 * Documentation Basics:: Where doc strings are defined and stored.
922 * Accessing Documentation:: How Lisp programs can access doc strings.
923 * Keys in Documentation:: Substituting current key bindings.
924 * Describing Characters:: Making printable descriptions of
925 non-printing characters and key sequences.
926 * Help Functions:: Subroutines used by Emacs help facilities.
927
928 Files
929
930 * Visiting Files:: Reading files into Emacs buffers for editing.
931 * Saving Buffers:: Writing changed buffers back into files.
932 * Reading from Files:: Reading files into buffers without visiting.
933 * Writing to Files:: Writing new files from parts of buffers.
934 * File Locks:: Locking and unlocking files, to prevent
935 simultaneous editing by two people.
936 * Information about Files:: Testing existence, accessibility, size of files.
937 * Changing Files:: Renaming files, changing permissions, etc.
938 * File Names:: Decomposing and expanding file names.
939 * Contents of Directories:: Getting a list of the files in a directory.
940 * Create/Delete Dirs:: Creating and Deleting Directories.
941 * Magic File Names:: Special handling for certain file names.
942 * Format Conversion:: Conversion to and from various file formats.
943
944 Visiting Files
945
946 * Visiting Functions:: The usual interface functions for visiting.
947 * Subroutines of Visiting:: Lower-level subroutines that they use.
948
949 Information about Files
950
951 * Testing Accessibility:: Is a given file readable? Writable?
952 * Kinds of Files:: Is it a directory? A symbolic link?
953 * Truenames:: Eliminating symbolic links from a file name.
954 * File Attributes:: How large is it? Any other names? Etc.
955 * Locating Files:: How to find a file in standard places.
956
957 File Names
958
959 * File Name Components:: The directory part of a file name, and the rest.
960 * Relative File Names:: Some file names are relative to a current directory.
961 * Directory Names:: A directory's name as a directory
962 is different from its name as a file.
963 * File Name Expansion:: Converting relative file names to absolute ones.
964 * Unique File Names:: Generating names for temporary files.
965 * File Name Completion:: Finding the completions for a given file name.
966 * Standard File Names:: If your package uses a fixed file name,
967 how to handle various operating systems simply.
968
969 File Format Conversion
970
971 * Format Conversion Overview:: @code{insert-file-contents} and @code{write-region}.
972 * Format Conversion Round-Trip:: Using @code{format-alist}.
973 * Format Conversion Piecemeal:: Specifying non-paired conversion.
974
975 Backups and Auto-Saving
976
977 * Backup Files:: How backup files are made; how their names
978 are chosen.
979 * Auto-Saving:: How auto-save files are made; how their
980 names are chosen.
981 * Reverting:: @code{revert-buffer}, and how to customize
982 what it does.
983
984 Backup Files
985
986 * Making Backups:: How Emacs makes backup files, and when.
987 * Rename or Copy:: Two alternatives: renaming the old file
988 or copying it.
989 * Numbered Backups:: Keeping multiple backups for each source file.
990 * Backup Names:: How backup file names are computed; customization.
991
992 Buffers
993
994 * Buffer Basics:: What is a buffer?
995 * Current Buffer:: Designating a buffer as current
996 so that primitives will access its contents.
997 * Buffer Names:: Accessing and changing buffer names.
998 * Buffer File Name:: The buffer file name indicates which file
999 is visited.
1000 * Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
1001 * Modification Time:: Determining whether the visited file was changed
1002 "behind Emacs's back".
1003 * Read Only Buffers:: Modifying text is not allowed in a
1004 read-only buffer.
1005 * The Buffer List:: How to look at all the existing buffers.
1006 * Creating Buffers:: Functions that create buffers.
1007 * Killing Buffers:: Buffers exist until explicitly killed.
1008 * Indirect Buffers:: An indirect buffer shares text with some
1009 other buffer.
1010 * Swapping Text:: Swapping text between two buffers.
1011 * Buffer Gap:: The gap in the buffer.
1012
1013 Windows
1014
1015 * Basic Windows:: Basic information on using windows.
1016 * Windows and Frames:: Relating windows to the frame they appear on.
1017 * Window Sizes:: Accessing a window's size.
1018 * Resizing Windows:: Changing the sizes of windows.
1019 * Splitting Windows:: Splitting one window into two windows.
1020 * Deleting Windows:: Deleting a window gives its space to other windows.
1021 * Recombining Windows:: Preserving the frame layout when splitting and
1022 deleting windows.
1023 * Selecting Windows:: The selected window is the one that you edit in.
1024 * Cyclic Window Ordering:: Moving around the existing windows.
1025 * Buffers and Windows:: Each window displays the contents of a buffer.
1026 * Switching Buffers:: Higher-level functions for switching to a buffer.
1027 * Choosing Window:: How to choose a window for displaying a buffer.
1028 * Display Action Functions:: Subroutines for @code{display-buffer}.
1029 * Choosing Window Options:: Extra options affecting how buffers are displayed.
1030 * Window History:: Each window remembers the buffers displayed in it.
1031 * Dedicated Windows:: How to avoid displaying another buffer in
1032 a specific window.
1033 * Quitting Windows:: How to restore the state prior to displaying a
1034 buffer.
1035 * Window Point:: Each window has its own location of point.
1036 * Window Start and End:: Buffer positions indicating which text is
1037 on-screen in a window.
1038 * Textual Scrolling:: Moving text up and down through the window.
1039 * Vertical Scrolling:: Moving the contents up and down on the window.
1040 * Horizontal Scrolling:: Moving the contents sideways on the window.
1041 * Coordinates and Windows:: Converting coordinates to windows.
1042 * Window Configurations:: Saving and restoring the state of the screen.
1043 * Window Parameters:: Associating additional information with windows.
1044 * Window Hooks:: Hooks for scrolling, window size changes,
1045 redisplay going past a certain point,
1046 or window configuration changes.
1047
1048 Frames
1049
1050 * Creating Frames:: Creating additional frames.
1051 * Multiple Terminals:: Displaying on several different devices.
1052 * Frame Parameters:: Controlling frame size, position, font, etc.
1053 * Terminal Parameters:: Parameters common for all frames on terminal.
1054 * Frame Titles:: Automatic updating of frame titles.
1055 * Deleting Frames:: Frames last until explicitly deleted.
1056 * Finding All Frames:: How to examine all existing frames.
1057 * Minibuffers and Frames:: How a frame finds the minibuffer to use.
1058 * Input Focus:: Specifying the selected frame.
1059 * Visibility of Frames:: Frames may be visible or invisible, or icons.
1060 * Raising and Lowering:: Raising a frame makes it hide other windows;
1061 lowering it makes the others hide it.
1062 * Frame Configurations:: Saving the state of all frames.
1063 * Mouse Tracking:: Getting events that say when the mouse moves.
1064 * Mouse Position:: Asking where the mouse is, or moving it.
1065 * Pop-Up Menus:: Displaying a menu for the user to select from.
1066 * Dialog Boxes:: Displaying a box to ask yes or no.
1067 * Pointer Shape:: Specifying the shape of the mouse pointer.
1068 * Window System Selections::Transferring text to and from other X clients.
1069 * Drag and Drop:: Internals of Drag-and-Drop implementation.
1070 * Color Names:: Getting the definitions of color names.
1071 * Text Terminal Colors:: Defining colors for text terminals.
1072 * Resources:: Getting resource values from the server.
1073 * Display Feature Testing:: Determining the features of a terminal.
1074
1075 Frame Parameters
1076
1077 * Parameter Access:: How to change a frame's parameters.
1078 * Initial Parameters:: Specifying frame parameters when you make a frame.
1079 * Window Frame Parameters:: List of frame parameters for window systems.
1080 * Size and Position:: Changing the size and position of a frame.
1081 * Geometry:: Parsing geometry specifications.
1082
1083 Window Frame Parameters
1084
1085 * Basic Parameters:: Parameters that are fundamental.
1086 * Position Parameters:: The position of the frame on the screen.
1087 * Size Parameters:: Frame's size.
1088 * Layout Parameters:: Size of parts of the frame, and
1089 enabling or disabling some parts.
1090 * Buffer Parameters:: Which buffers have been or should be shown.
1091 * Management Parameters:: Communicating with the window manager.
1092 * Cursor Parameters:: Controlling the cursor appearance.
1093 * Font and Color Parameters:: Fonts and colors for the frame text.
1094
1095 Positions
1096
1097 * Point:: The special position where editing takes place.
1098 * Motion:: Changing point.
1099 * Excursions:: Temporary motion and buffer changes.
1100 * Narrowing:: Restricting editing to a portion of the buffer.
1101
1102 Motion
1103
1104 * Character Motion:: Moving in terms of characters.
1105 * Word Motion:: Moving in terms of words.
1106 * Buffer End Motion:: Moving to the beginning or end of the buffer.
1107 * Text Lines:: Moving in terms of lines of text.
1108 * Screen Lines:: Moving in terms of lines as displayed.
1109 * List Motion:: Moving by parsing lists and sexps.
1110 * Skipping Characters:: Skipping characters belonging to a certain set.
1111
1112 Markers
1113
1114 * Overview of Markers:: The components of a marker, and how it relocates.
1115 * Predicates on Markers:: Testing whether an object is a marker.
1116 * Creating Markers:: Making empty markers or markers at certain places.
1117 * Information from Markers::Finding the marker's buffer or character position.
1118 * Marker Insertion Types:: Two ways a marker can relocate when you
1119 insert where it points.
1120 * Moving Markers:: Moving the marker to a new buffer or position.
1121 * The Mark:: How "the mark" is implemented with a marker.
1122 * The Region:: How to access "the region".
1123
1124 Text
1125
1126 * Near Point:: Examining text in the vicinity of point.
1127 * Buffer Contents:: Examining text in a general fashion.
1128 * Comparing Text:: Comparing substrings of buffers.
1129 * Insertion:: Adding new text to a buffer.
1130 * Commands for Insertion:: User-level commands to insert text.
1131 * Deletion:: Removing text from a buffer.
1132 * User-Level Deletion:: User-level commands to delete text.
1133 * The Kill Ring:: Where removed text sometimes is saved for
1134 later use.
1135 * Undo:: Undoing changes to the text of a buffer.
1136 * Maintaining Undo:: How to enable and disable undo information.
1137 How to control how much information is kept.
1138 * Filling:: Functions for explicit filling.
1139 * Margins:: How to specify margins for filling commands.
1140 * Adaptive Fill:: Adaptive Fill mode chooses a fill prefix
1141 from context.
1142 * Auto Filling:: How auto-fill mode is implemented to break lines.
1143 * Sorting:: Functions for sorting parts of the buffer.
1144 * Columns:: Computing horizontal positions, and using them.
1145 * Indentation:: Functions to insert or adjust indentation.
1146 * Case Changes:: Case conversion of parts of the buffer.
1147 * Text Properties:: Assigning Lisp property lists to text characters.
1148 * Substitution:: Replacing a given character wherever it appears.
1149 * Registers:: How registers are implemented. Accessing
1150 the text or position stored in a register.
1151 * Transposition:: Swapping two portions of a buffer.
1152 * Base 64:: Conversion to or from base 64 encoding.
1153 * Checksum/Hash:: Computing cryptographic hashes.
1154 * Parsing HTML/XML:: Parsing HTML and XML.
1155 * Atomic Changes:: Installing several buffer changes "atomically".
1156 * Change Hooks:: Supplying functions to be run when text is changed.
1157
1158 The Kill Ring
1159
1160 * Kill Ring Concepts:: What text looks like in the kill ring.
1161 * Kill Functions:: Functions that kill text.
1162 * Yanking:: How yanking is done.
1163 * Yank Commands:: Commands that access the kill ring.
1164 * Low-Level Kill Ring:: Functions and variables for kill ring access.
1165 * Internals of Kill Ring:: Variables that hold kill ring data.
1166
1167 Indentation
1168
1169 * Primitive Indent:: Functions used to count and insert indentation.
1170 * Mode-Specific Indent:: Customize indentation for different modes.
1171 * Region Indent:: Indent all the lines in a region.
1172 * Relative Indent:: Indent the current line based on previous lines.
1173 * Indent Tabs:: Adjustable, typewriter-like tab stops.
1174 * Motion by Indent:: Move to first non-blank character.
1175
1176 Text Properties
1177
1178 * Examining Properties:: Looking at the properties of one character.
1179 * Changing Properties:: Setting the properties of a range of text.
1180 * Property Search:: Searching for where a property changes value.
1181 * Special Properties:: Particular properties with special meanings.
1182 * Format Properties:: Properties for representing formatting of text.
1183 * Sticky Properties:: How inserted text gets properties from
1184 neighboring text.
1185 * Lazy Properties:: Computing text properties in a lazy fashion
1186 only when text is examined.
1187 * Clickable Text:: Using text properties to make regions of text
1188 do something when you click on them.
1189 * Fields:: The @code{field} property defines
1190 fields within the buffer.
1191 * Not Intervals:: Why text properties do not use
1192 Lisp-visible text intervals.
1193
1194 Non-@acronym{ASCII} Characters
1195
1196 * Text Representations:: How Emacs represents text.
1197 * Disabling Multibyte:: Controlling whether to use multibyte characters.
1198 * Converting Representations:: Converting unibyte to multibyte and vice versa.
1199 * Selecting a Representation:: Treating a byte sequence as unibyte or multi.
1200 * Character Codes:: How unibyte and multibyte relate to
1201 codes of individual characters.
1202 * Character Properties:: Character attributes that define their
1203 behavior and handling.
1204 * Character Sets:: The space of possible character codes
1205 is divided into various character sets.
1206 * Scanning Charsets:: Which character sets are used in a buffer?
1207 * Translation of Characters:: Translation tables are used for conversion.
1208 * Coding Systems:: Coding systems are conversions for saving files.
1209 * Input Methods:: Input methods allow users to enter various
1210 non-ASCII characters without special keyboards.
1211 * Locales:: Interacting with the POSIX locale.
1212
1213 Coding Systems
1214
1215 * Coding System Basics:: Basic concepts.
1216 * Encoding and I/O:: How file I/O functions handle coding systems.
1217 * Lisp and Coding Systems:: Functions to operate on coding system names.
1218 * User-Chosen Coding Systems:: Asking the user to choose a coding system.
1219 * Default Coding Systems:: Controlling the default choices.
1220 * Specifying Coding Systems:: Requesting a particular coding system
1221 for a single file operation.
1222 * Explicit Encoding:: Encoding or decoding text without doing I/O.
1223 * Terminal I/O Encoding:: Use of encoding for terminal I/O.
1224
1225 Searching and Matching
1226
1227 * String Search:: Search for an exact match.
1228 * Searching and Case:: Case-independent or case-significant searching.
1229 * Regular Expressions:: Describing classes of strings.
1230 * Regexp Search:: Searching for a match for a regexp.
1231 * POSIX Regexps:: Searching POSIX-style for the longest match.
1232 * Match Data:: Finding out which part of the text matched,
1233 after a string or regexp search.
1234 * Search and Replace:: Commands that loop, searching and replacing.
1235 * Standard Regexps:: Useful regexps for finding sentences, pages,...
1236
1237 Regular Expressions
1238
1239 * Syntax of Regexps:: Rules for writing regular expressions.
1240 * Regexp Example:: Illustrates regular expression syntax.
1241 * Regexp Functions:: Functions for operating on regular expressions.
1242
1243 Syntax of Regular Expressions
1244
1245 * Regexp Special:: Special characters in regular expressions.
1246 * Char Classes:: Character classes used in regular expressions.
1247 * Regexp Backslash:: Backslash-sequences in regular expressions.
1248
1249 The Match Data
1250
1251 * Replacing Match:: Replacing a substring that was matched.
1252 * Simple Match Data:: Accessing single items of match data,
1253 such as where a particular subexpression started.
1254 * Entire Match Data:: Accessing the entire match data at once, as a list.
1255 * Saving Match Data:: Saving and restoring the match data.
1256
1257 Syntax Tables
1258
1259 * Syntax Basics:: Basic concepts of syntax tables.
1260 * Syntax Descriptors:: How characters are classified.
1261 * Syntax Table Functions:: How to create, examine and alter syntax tables.
1262 * Syntax Properties:: Overriding syntax with text properties.
1263 * Motion and Syntax:: Moving over characters with certain syntaxes.
1264 * Parsing Expressions:: Parsing balanced expressions
1265 using the syntax table.
1266 * Syntax Table Internals:: How syntax table information is stored.
1267 * Categories:: Another way of classifying character syntax.
1268
1269 Syntax Descriptors
1270
1271 * Syntax Class Table:: Table of syntax classes.
1272 * Syntax Flags:: Additional flags each character can have.
1273
1274 Parsing Expressions
1275
1276 * Motion via Parsing:: Motion functions that work by parsing.
1277 * Position Parse:: Determining the syntactic state of a position.
1278 * Parser State:: How Emacs represents a syntactic state.
1279 * Low-Level Parsing:: Parsing across a specified region.
1280 * Control Parsing:: Parameters that affect parsing.
1281
1282 Abbrevs and Abbrev Expansion
1283
1284 * Abbrev Tables:: Creating and working with abbrev tables.
1285 * Defining Abbrevs:: Specifying abbreviations and their expansions.
1286 * Abbrev Files:: Saving abbrevs in files.
1287 * Abbrev Expansion:: Controlling expansion; expansion subroutines.
1288 * Standard Abbrev Tables:: Abbrev tables used by various major modes.
1289 * Abbrev Properties:: How to read and set abbrev properties.
1290 Which properties have which effect.
1291 * Abbrev Table Properties:: How to read and set abbrev table properties.
1292 Which properties have which effect.
1293
1294 Processes
1295
1296 * Subprocess Creation:: Functions that start subprocesses.
1297 * Shell Arguments:: Quoting an argument to pass it to a shell.
1298 * Synchronous Processes:: Details of using synchronous subprocesses.
1299 * Asynchronous Processes:: Starting up an asynchronous subprocess.
1300 * Deleting Processes:: Eliminating an asynchronous subprocess.
1301 * Process Information:: Accessing run-status and other attributes.
1302 * Input to Processes:: Sending input to an asynchronous subprocess.
1303 * Signals to Processes:: Stopping, continuing or interrupting
1304 an asynchronous subprocess.
1305 * Output from Processes:: Collecting output from an asynchronous subprocess.
1306 * Sentinels:: Sentinels run when process run-status changes.
1307 * Query Before Exit:: Whether to query if exiting will kill a process.
1308 * System Processes:: Accessing other processes running on your system.
1309 * Transaction Queues:: Transaction-based communication with subprocesses.
1310 * Network:: Opening network connections.
1311 * Network Servers:: Network servers let Emacs accept net connections.
1312 * Datagrams:: UDP network connections.
1313 * Low-Level Network:: Lower-level but more general function
1314 to create connections and servers.
1315 * Misc Network:: Additional relevant functions for net connections.
1316 * Serial Ports:: Communicating with serial ports.
1317 * Byte Packing:: Using bindat to pack and unpack binary data.
1318
1319 Receiving Output from Processes
1320
1321 * Process Buffers:: If no filter, output is put in a buffer.
1322 * Filter Functions:: Filter functions accept output from the process.
1323 * Decoding Output:: Filters can get unibyte or multibyte strings.
1324 * Accepting Output:: How to wait until process output arrives.
1325
1326 Low-Level Network Access
1327
1328 * Network Processes:: Using @code{make-network-process}.
1329 * Network Options:: Further control over network connections.
1330 * Network Feature Testing:: Determining which network features work on
1331 the machine you are using.
1332
1333 Packing and Unpacking Byte Arrays
1334
1335 * Bindat Spec:: Describing data layout.
1336 * Bindat Functions:: Doing the unpacking and packing.
1337 * Bindat Examples:: Samples of what bindat.el can do for you!
1338
1339 Emacs Display
1340
1341 * Refresh Screen:: Clearing the screen and redrawing everything on it.
1342 * Forcing Redisplay:: Forcing redisplay.
1343 * Truncation:: Folding or wrapping long text lines.
1344 * The Echo Area:: Displaying messages at the bottom of the screen.
1345 * Warnings:: Displaying warning messages for the user.
1346 * Invisible Text:: Hiding part of the buffer text.
1347 * Selective Display:: Hiding part of the buffer text (the old way).
1348 * Temporary Displays:: Displays that go away automatically.
1349 * Overlays:: Use overlays to highlight parts of the buffer.
1350 * Width:: How wide a character or string is on the screen.
1351 * Line Height:: Controlling the height of lines.
1352 * Faces:: A face defines a graphics style
1353 for text characters: font, colors, etc.
1354 * Fringes:: Controlling window fringes.
1355 * Scroll Bars:: Controlling vertical scroll bars.
1356 * Display Property:: Enabling special display features.
1357 * Images:: Displaying images in Emacs buffers.
1358 * Buttons:: Adding clickable buttons to Emacs buffers.
1359 * Abstract Display:: Emacs's Widget for Object Collections.
1360 * Blinking:: How Emacs shows the matching open parenthesis.
1361 * Character Display:: How Emacs displays individual characters.
1362 * Beeping:: Audible signal to the user.
1363 * Window Systems:: Which window system is being used.
1364 * Bidirectional Display:: Display of bidirectional scripts, such as
1365 Arabic and Farsi.
1366
1367 The Echo Area
1368
1369 * Displaying Messages:: Explicitly displaying text in the echo area.
1370 * Progress:: Informing user about progress of a long operation.
1371 * Logging Messages:: Echo area messages are logged for the user.
1372 * Echo Area Customization:: Controlling the echo area.
1373
1374 Reporting Warnings
1375
1376 * Warning Basics:: Warnings concepts and functions to report them.
1377 * Warning Variables:: Variables programs bind to customize
1378 their warnings.
1379 * Warning Options:: Variables users set to control display of warnings.
1380 * Delayed Warnings:: Deferring a warning until the end of a command.
1381
1382 Overlays
1383
1384 * Managing Overlays:: Creating and moving overlays.
1385 * Overlay Properties:: How to read and set properties.
1386 What properties do to the screen display.
1387 * Finding Overlays:: Searching for overlays.
1388
1389 Faces
1390
1391 * Face Attributes:: What is in a face?
1392 * Defining Faces:: How to define a face.
1393 * Attribute Functions:: Functions to examine and set face attributes.
1394 * Displaying Faces:: How Emacs combines the faces specified for
1395 a character.
1396 * Face Remapping:: Remapping faces to alternative definitions.
1397 * Face Functions:: How to define and examine faces.
1398 * Auto Faces:: Hook for automatic face assignment.
1399 * Basic Faces:: Faces that are defined by default.
1400 * Font Selection:: Finding the best available font for a face.
1401 * Font Lookup:: Looking up the names of available fonts
1402 and information about them.
1403 * Fontsets:: A fontset is a collection of fonts
1404 that handle a range of character sets.
1405 * Low-Level Font:: Lisp representation for character display fonts.
1406
1407 Fringes
1408
1409 * Fringe Size/Pos:: Specifying where to put the window fringes.
1410 * Fringe Indicators:: Displaying indicator icons in the window fringes.
1411 * Fringe Cursors:: Displaying cursors in the right fringe.
1412 * Fringe Bitmaps:: Specifying bitmaps for fringe indicators.
1413 * Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
1414 * Overlay Arrow:: Display of an arrow to indicate position.
1415
1416 The @code{display} Property
1417
1418 * Replacing Specs:: Display specs that replace the text.
1419 * Specified Space:: Displaying one space with a specified width.
1420 * Pixel Specification:: Specifying space width or height in pixels.
1421 * Other Display Specs:: Displaying an image; adjusting the height,
1422 spacing, and other properties of text.
1423 * Display Margins:: Displaying text or images to the side of
1424 the main text.
1425
1426 Images
1427
1428 * Image Formats:: Supported image formats.
1429 * Image Descriptors:: How to specify an image for use in @code{:display}.
1430 * XBM Images:: Special features for XBM format.
1431 * XPM Images:: Special features for XPM format.
1432 * PostScript Images:: Special features for PostScript format.
1433 * ImageMagick Images:: Special features available through ImageMagick.
1434 * Other Image Types:: Various other formats are supported.
1435 * Defining Images:: Convenient ways to define an image for later use.
1436 * Showing Images:: Convenient ways to display an image once
1437 it is defined.
1438 * Multi-Frame Images:: Some images contain more than one frame.
1439 * Image Cache:: Internal mechanisms of image display.
1440
1441 Buttons
1442
1443 * Button Properties:: Button properties with special meanings.
1444 * Button Types:: Defining common properties for classes of buttons.
1445 * Making Buttons:: Adding buttons to Emacs buffers.
1446 * Manipulating Buttons:: Getting and setting properties of buttons.
1447 * Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
1448
1449 Abstract Display
1450
1451 * Abstract Display Functions:: Functions in the Ewoc package.
1452 * Abstract Display Example:: Example of using Ewoc.
1453
1454 Character Display
1455
1456 * Usual Display:: The usual conventions for displaying characters.
1457 * Display Tables:: What a display table consists of.
1458 * Active Display Table:: How Emacs selects a display table to use.
1459 * Glyphs:: How to define a glyph, and what glyphs mean.
1460 * Glyphless Chars:: How glyphless characters are drawn.
1461
1462 Operating System Interface
1463
1464 * Starting Up:: Customizing Emacs startup processing.
1465 * Getting Out:: How exiting works (permanent or temporary).
1466 * System Environment:: Distinguish the name and kind of system.
1467 * User Identification:: Finding the name and user id of the user.
1468 * Time of Day:: Getting the current time.
1469 * Time Conversion:: Converting a time from numeric form to
1470 calendrical data and vice versa.
1471 * Time Parsing:: Converting a time from numeric form to text
1472 and vice versa.
1473 * Processor Run Time:: Getting the run time used by Emacs.
1474 * Time Calculations:: Adding, subtracting, comparing times, etc.
1475 * Timers:: Setting a timer to call a function at a
1476 certain time.
1477 * Idle Timers:: Setting a timer to call a function when Emacs has
1478 been idle for a certain length of time.
1479 * Terminal Input:: Accessing and recording terminal input.
1480 * Terminal Output:: Controlling and recording terminal output.
1481 * Sound Output:: Playing sounds on the computer's speaker.
1482 * X11 Keysyms:: Operating on key symbols for X Windows.
1483 * Batch Mode:: Running Emacs without terminal interaction.
1484 * Session Management:: Saving and restoring state with
1485 X Session Management.
1486 * Desktop Notifications:: Desktop notifications.
1487 * File Notifications:: File notifications.
1488 * Dynamic Libraries:: On-demand loading of support libraries.
1489
1490 Starting Up Emacs
1491
1492 * Startup Summary:: Sequence of actions Emacs performs at startup.
1493 * Init File:: Details on reading the init file.
1494 * Terminal-Specific:: How the terminal-specific Lisp file is read.
1495 * Command-Line Arguments:: How command-line arguments are processed,
1496 and how you can customize them.
1497
1498 Getting Out of Emacs
1499
1500 * Killing Emacs:: Exiting Emacs irreversibly.
1501 * Suspending Emacs:: Exiting Emacs reversibly.
1502
1503 Terminal Input
1504
1505 * Input Modes:: Options for how input is processed.
1506 * Recording Input:: Saving histories of recent or all input events.
1507
1508 Preparing Lisp code for distribution
1509
1510 * Packaging Basics:: The basic concepts of Emacs Lisp packages.
1511 * Simple Packages:: How to package a single .el file.
1512 * Multi-file Packages:: How to package multiple files.
1513 * Package Archives:: Maintaining package archives.
1514
1515 Tips and Conventions
1516
1517 * Coding Conventions:: Conventions for clean and robust programs.
1518 * Key Binding Conventions:: Which keys should be bound by which programs.
1519 * Programming Tips:: Making Emacs code fit smoothly in Emacs.
1520 * Compilation Tips:: Making compiled code run fast.
1521 * Warning Tips:: Turning off compiler warnings.
1522 * Documentation Tips:: Writing readable documentation strings.
1523 * Comment Tips:: Conventions for writing comments.
1524 * Library Headers:: Standard headers for library packages.
1525
1526 GNU Emacs Internals
1527
1528 * Building Emacs:: How the dumped Emacs is made.
1529 * Pure Storage:: Kludge to make preloaded Lisp functions shareable.
1530 * Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1531 * Memory Usage:: Info about total size of Lisp objects made so far.
1532 * Writing Emacs Primitives:: Writing C code for Emacs.
1533 * Object Internals:: Data formats of buffers, windows, processes.
1534
1535 Object Internals
1536
1537 * Buffer Internals:: Components of a buffer structure.
1538 * Window Internals:: Components of a window structure.
1539 * Process Internals:: Components of a process structure.
1540 @end detailmenu
1541 @end menu
1542
1543 @ifclear VOL2
1544 @include intro.texi
1545 @include objects.texi
1546 @include numbers.texi
1547 @include strings.texi
1548
1549 @include lists.texi
1550 @include sequences.texi
1551 @include hash.texi
1552 @include symbols.texi
1553 @include eval.texi
1554
1555 @include control.texi
1556 @include variables.texi
1557 @include functions.texi
1558 @include macros.texi
1559
1560 @include customize.texi
1561 @include loading.texi
1562 @include compile.texi
1563 @include advice.texi
1564
1565 @c This includes edebug.texi.
1566 @include debugging.texi
1567 @include streams.texi
1568 @include minibuf.texi
1569 @include commands.texi
1570
1571 @include keymaps.texi
1572 @include modes.texi
1573 @include help.texi
1574 @include files.texi
1575
1576 @include backups.texi
1577
1578 @end ifclear
1579
1580 @c ================ Beginning of Volume 2 ================
1581 @ifclear VOL1
1582
1583 @include buffers.texi
1584 @include windows.texi
1585 @include frames.texi
1586
1587 @include positions.texi
1588 @include markers.texi
1589 @include text.texi
1590 @include nonascii.texi
1591
1592 @include searching.texi
1593 @include syntax.texi
1594 @include abbrevs.texi
1595 @include processes.texi
1596
1597 @include display.texi
1598 @include os.texi
1599
1600 @include package.texi
1601
1602 @c appendices
1603
1604 @include anti.texi
1605 @node GNU Free Documentation License
1606 @appendix GNU Free Documentation License
1607 @include doclicense.texi
1608 @node GPL
1609 @appendix GNU General Public License
1610 @include gpl.texi
1611 @include tips.texi
1612 @include internals.texi
1613 @include errors.texi
1614 @include maps.texi
1615 @include hooks.texi
1616
1617 @include index.texi
1618
1619 @end ifclear
1620
1621 @ignore
1622 @node New Symbols
1623 @unnumbered New Symbols Since the Previous Edition
1624
1625 @printindex tp
1626 @end ignore
1627
1628 @bye
1629
1630 \f
1631 These words prevent "local variables" above from confusing Emacs.