Commit | Line | Data |
---|---|---|
a44af9f2 RS |
1 | \input texinfo @c -*-texinfo-*- |
2 | @c %**start of header | |
3 | @setfilename elisp | |
a44af9f2 RS |
4 | @settitle GNU Emacs Lisp Reference Manual |
5 | @c %**end of header | |
6 | ||
221fc415 RS |
7 | @dircategory Editors |
8 | @direntry | |
9 | * Elisp: (elisp). The Emacs Lisp Reference Manual. | |
10 | @end direntry | |
11 | ||
a9f0a989 RS |
12 | @smallbook |
13 | ||
a44af9f2 | 14 | @ifinfo |
f9f59935 RS |
15 | This version is the edition 2.5 of the GNU Emacs Lisp |
16 | Reference Manual. It corresponds to Emacs Version 20.3 | |
a44af9f2 RS |
17 | @c Please REMEMBER to update edition number in *four* places in this file |
18 | @c and also in *one* place in intro.texi | |
19 | ||
20 | Published by the Free Software Foundation | |
840797ee KH |
21 | 59 Temple Place, Suite 330 |
22 | Boston, MA 02111-1307 USA | |
a44af9f2 | 23 | |
f9f59935 | 24 | Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc. |
a44af9f2 RS |
25 | |
26 | Permission is granted to make and distribute verbatim copies of this | |
27 | manual provided the copyright notice and this permission notice are | |
28 | preserved on all copies. | |
29 | ||
30 | @ignore | |
31 | Permission is granted to process this file through TeX and print the | |
32 | results, provided the printed document carries copying permission notice | |
33 | identical to this one except for the removal of this paragraph (this | |
34 | paragraph not being relevant to the printed manual). | |
35 | ||
36 | @end ignore | |
37 | Permission is granted to copy and distribute modified versions of this | |
38 | manual under the conditions for verbatim copying, provided that the | |
39 | entire resulting derived work is distributed under the terms of a | |
40 | permission notice identical to this one. | |
41 | ||
42 | Permission is granted to copy and distribute translations of this manual | |
43 | into another language, under the above conditions for modified versions, | |
44 | except that this permission notice may be stated in a translation | |
45 | approved by the Foundation. | |
46 | ||
47 | Permission is granted to copy and distribute modified versions of this | |
48 | manual under the conditions for verbatim copying, provided also that the | |
49 | section entitled ``GNU General Public License'' is included exactly as | |
50 | in the original, and provided that the entire resulting derived work is | |
51 | distributed under the terms of a permission notice identical to this | |
52 | one. | |
53 | ||
54 | Permission is granted to copy and distribute translations of this manual | |
55 | into another language, under the above conditions for modified versions, | |
56 | except that the section entitled ``GNU General Public License'' may be | |
57 | included in a translation approved by the Free Software Foundation | |
58 | instead of in the original English. | |
59 | @end ifinfo | |
60 | ||
61 | @c Combine indices. | |
62 | @synindex cp fn | |
63 | @syncodeindex vr fn | |
64 | @syncodeindex ky fn | |
65 | @syncodeindex pg fn | |
f9f59935 RS |
66 | @c We use the "type index" to index new functions and variables. |
67 | @c @syncodeindex tp fn | |
a44af9f2 RS |
68 | |
69 | @setchapternewpage odd | |
70 | @finalout | |
71 | ||
72 | @titlepage | |
73 | @title GNU Emacs Lisp Reference Manual | |
1911e6e5 | 74 | @subtitle For Emacs Version 20.3 |
a44af9f2 RS |
75 | @c The edition number appears in several places in this file |
76 | @c and also in the file intro.texi. | |
1911e6e5 | 77 | @subtitle Revision 2.5, May 1998 |
a44af9f2 RS |
78 | |
79 | @author by Bil Lewis, Dan LaLiberte, Richard Stallman | |
80 | @author and the GNU Manual Group | |
81 | @page | |
82 | @vskip 0pt plus 1filll | |
f9f59935 | 83 | Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc. |
a44af9f2 RS |
84 | |
85 | @sp 2 | |
f9f59935 RS |
86 | Edition 2.5 @* |
87 | Revised for Emacs Version 20.3,@* | |
1911e6e5 | 88 | May 1998.@* |
a44af9f2 | 89 | @sp 2 |
1911e6e5 | 90 | ISBN 1-882114-72-8 |
a44af9f2 RS |
91 | |
92 | @sp 2 | |
93 | Published by the Free Software Foundation @* | |
840797ee KH |
94 | 59 Temple Place, Suite 330@* |
95 | Boston, MA 02111-1307 USA | |
a44af9f2 RS |
96 | |
97 | Permission is granted to make and distribute verbatim copies of this | |
98 | manual provided the copyright notice and this permission notice are | |
99 | preserved on all copies. | |
100 | ||
101 | Permission is granted to copy and distribute modified versions of this | |
102 | manual under the conditions for verbatim copying, provided also that the | |
103 | section entitled ``GNU General Public License'' is included | |
104 | exactly as in the original, and provided that the entire resulting | |
105 | derived work is distributed under the terms of a permission notice | |
106 | identical to this one. | |
107 | ||
108 | Permission is granted to copy and distribute translations of this manual | |
109 | into another language, under the above conditions for modified versions, | |
110 | except that the section entitled ``GNU General Public License'' may be | |
111 | included in a translation approved by the Free Software Foundation | |
112 | instead of in the original English. | |
113 | ||
114 | Cover art by Etienne Suvasa. | |
115 | @end titlepage | |
116 | @page | |
117 | ||
118 | @node Top, Copying, (dir), (dir) | |
119 | ||
120 | @ifinfo | |
f9f59935 RS |
121 | This Info file contains edition 2.5 of the GNU Emacs Lisp |
122 | Reference Manual, corresponding to GNU Emacs version 20.3. | |
a44af9f2 RS |
123 | @end ifinfo |
124 | ||
125 | @menu | |
126 | * Copying:: Conditions for copying and changing GNU Emacs. | |
127 | * Introduction:: Introduction and conventions used. | |
4356e9eb | 128 | * Standards: Coding Conventions. Coding conventions for Emacs Lisp. |
a44af9f2 | 129 | |
3e099569 | 130 | * Lisp Data Types:: Data types of objects in Emacs Lisp. |
a44af9f2 RS |
131 | * Numbers:: Numbers and arithmetic functions. |
132 | * Strings and Characters:: Strings, and functions that work on them. | |
133 | * Lists:: Lists, cons cells, and related functions. | |
134 | * Sequences Arrays Vectors:: Lists, strings and vectors are called sequences. | |
135 | Certain functions act on any kind of sequence. | |
136 | The description of vectors is here as well. | |
137 | * Symbols:: Symbols represent names, uniquely. | |
138 | ||
139 | * Evaluation:: How Lisp expressions are evaluated. | |
140 | * Control Structures:: Conditionals, loops, nonlocal exits. | |
141 | * Variables:: Using symbols in programs to stand for values. | |
142 | * Functions:: A function is a Lisp program | |
143 | that can be invoked from other functions. | |
144 | * Macros:: Macros are a way to extend the Lisp language. | |
f9f59935 | 145 | * Customization:: Writing customization declarations. |
a44af9f2 RS |
146 | |
147 | * Loading:: Reading files of Lisp code into Lisp. | |
148 | * Byte Compilation:: Compilation makes programs run faster. | |
cc236dfe | 149 | * Advising Functions:: Adding to the definition of a function. |
a44af9f2 RS |
150 | * Debugging:: Tools and tips for debugging Lisp programs. |
151 | ||
3e099569 | 152 | * Read and Print:: Converting Lisp objects to text and back. |
a44af9f2 RS |
153 | * Minibuffers:: Using the minibuffer to read input. |
154 | * Command Loop:: How the editor command loop works, | |
155 | and how you can call its subroutines. | |
156 | * Keymaps:: Defining the bindings from keys to commands. | |
157 | * Modes:: Defining major and minor modes. | |
158 | * Documentation:: Writing and using documentation strings. | |
159 | ||
160 | * Files:: Accessing files. | |
161 | * Backups and Auto-Saving:: Controlling how backups and auto-save | |
162 | files are made. | |
163 | * Buffers:: Creating and using buffer objects. | |
164 | * Windows:: Manipulating windows and displaying buffers. | |
165 | * Frames:: Making multiple X windows. | |
166 | * Positions:: Buffer positions and motion functions. | |
167 | * Markers:: Markers represent positions and update | |
168 | automatically when the text is changed. | |
169 | ||
170 | * Text:: Examining and changing text in buffers. | |
f9f59935 | 171 | * Non-ASCII Characters:: Non-ASCII text in buffers and strings. |
a44af9f2 RS |
172 | * Searching and Matching:: Searching buffers for strings or regexps. |
173 | * Syntax Tables:: The syntax table controls word and list parsing. | |
174 | * Abbrevs:: How Abbrev mode works, and its data structures. | |
175 | ||
176 | * Processes:: Running and communicating with subprocesses. | |
177 | * System Interface:: Getting the user id, system type, environment | |
178 | variables, and other such things. | |
179 | * Display:: Parameters controlling screen usage. | |
180 | The bell. Waiting for input. | |
181 | * Calendar:: Customizing the calendar and diary. | |
182 | ||
183 | Appendices | |
184 | ||
4356e9eb | 185 | * Tips:: Advice and coding conventions for Emacs Lisp. |
a44af9f2 RS |
186 | * GNU Emacs Internals:: Building and dumping Emacs; |
187 | internal data structures. | |
188 | * Standard Errors:: List of all error symbols. | |
cc236dfe RS |
189 | * Standard Buffer-Local Variables:: |
190 | List of variables buffer-local in all buffers. | |
a44af9f2 RS |
191 | * Standard Keymaps:: List of standard keymaps. |
192 | * Standard Hooks:: List of standard hook variables. | |
193 | ||
a44af9f2 RS |
194 | * Index:: Index including concepts, functions, variables, |
195 | and other terms. | |
196 | ||
f9f59935 RS |
197 | * New Symbols:: New functions and variables in Emacs 20. |
198 | ||
a44af9f2 RS |
199 | --- The Detailed Node Listing --- |
200 | ||
201 | Here are other nodes that are inferiors of those already listed, | |
202 | mentioned here so you can get to them in one step: | |
203 | ||
204 | Introduction | |
205 | ||
206 | * Caveats:: Flaws and a request for help. | |
207 | * Lisp History:: Emacs Lisp is descended from Maclisp. | |
208 | * Conventions:: How the manual is formatted. | |
209 | * Acknowledgements:: The authors, editors, and sponsors of this manual. | |
210 | ||
211 | Conventions | |
212 | ||
213 | * Some Terms:: Explanation of terms we use in this manual. | |
214 | * nil and t:: How the symbols @code{nil} and @code{t} are used. | |
215 | * Evaluation Notation:: The format we use for examples of evaluation. | |
216 | * Printing Notation:: The format we use for examples that print output. | |
217 | * Error Messages:: The format we use for examples of errors. | |
218 | * Buffer Text Notation:: The format we use for buffer contents in examples. | |
219 | * Format of Descriptions:: Notation for describing functions, variables, etc. | |
220 | ||
4356e9eb RS |
221 | Tips and Conventions |
222 | ||
223 | * Coding Conventions:: Conventions for clean and robust programs. | |
224 | * Compilation Tips:: Making compiled code run fast. | |
225 | * Documentation Tips:: Writing readable documentation strings. | |
226 | * Comment Tips:: Conventions for writing comments. | |
227 | * Library Headers:: Standard headers for library packages. | |
228 | ||
a44af9f2 RS |
229 | Format of Descriptions |
230 | ||
231 | * A Sample Function Description:: | |
232 | * A Sample Variable Description:: | |
233 | ||
234 | Lisp Data Types | |
235 | ||
236 | * Printed Representation:: How Lisp objects are represented as text. | |
237 | * Comments:: Comments and their formatting conventions. | |
238 | * Programming Types:: Types found in all Lisp systems. | |
239 | * Editing Types:: Types specific to Emacs. | |
240 | * Type Predicates:: Tests related to types. | |
241 | * Equality Predicates:: Tests of equality between any two objects. | |
242 | ||
243 | Programming Types | |
244 | ||
245 | * Integer Type:: Numbers without fractional parts. | |
246 | * Floating Point Type:: Numbers with fractional parts and with a large range. | |
247 | * Character Type:: The representation of letters, numbers and | |
248 | control characters. | |
249 | * Sequence Type:: Both lists and arrays are classified as sequences. | |
3e099569 | 250 | * Cons Cell Type:: Cons cells, and lists (which are made from cons cells). |
a44af9f2 RS |
251 | * Array Type:: Arrays include strings and vectors. |
252 | * String Type:: An (efficient) array of characters. | |
253 | * Vector Type:: One-dimensional arrays. | |
254 | * Symbol Type:: A multi-use object that refers to a function, | |
255 | variable, property list, or itself. | |
3e099569 RS |
256 | * Function Type:: A piece of executable code you can call from elsewhere. |
257 | * Macro Type:: A method of expanding an expression into another | |
a44af9f2 RS |
258 | expression, more fundamental but less pretty. |
259 | * Primitive Function Type:: A function written in C, callable from Lisp. | |
260 | * Byte-Code Type:: A function written in Lisp, then compiled. | |
261 | * Autoload Type:: A type used for automatically loading seldom-used | |
262 | functions. | |
263 | ||
264 | List Type | |
265 | ||
266 | * Dotted Pair Notation:: An alternative syntax for lists. | |
267 | * Association List Type:: A specially constructed list. | |
268 | ||
269 | Editing Types | |
270 | ||
271 | * Buffer Type:: The basic object of editing. | |
272 | * Window Type:: What makes buffers visible. | |
273 | * Window Configuration Type::Save what the screen looks like. | |
274 | * Marker Type:: A position in a buffer. | |
275 | * Process Type:: A process running on the underlying OS. | |
276 | * Stream Type:: Receive or send characters. | |
277 | * Keymap Type:: What function a keystroke invokes. | |
1911e6e5 | 278 | * Overlay Type:: How an overlay is represented. |
a44af9f2 RS |
279 | |
280 | Numbers | |
281 | ||
282 | * Integer Basics:: Representation and range of integers. | |
283 | * Float Basics:: Representation and range of floating point. | |
284 | * Predicates on Numbers:: Testing for numbers. | |
285 | * Comparison of Numbers:: Equality and inequality predicates. | |
286 | * Arithmetic Operations:: How to add, subtract, multiply and divide. | |
287 | * Bitwise Operations:: Logical and, or, not, shifting. | |
288 | * Numeric Conversions:: Converting float to integer and vice versa. | |
22697dac | 289 | * Math Functions:: Trig, exponential and logarithmic functions. |
a44af9f2 RS |
290 | * Random Numbers:: Obtaining random integers, predictable or not. |
291 | ||
292 | Strings and Characters | |
293 | ||
294 | * String Basics:: Basic properties of strings and characters. | |
295 | * Predicates for Strings:: Testing whether an object is a string or char. | |
296 | * Creating Strings:: Functions to allocate new strings. | |
297 | * Text Comparison:: Comparing characters or strings. | |
298 | * String Conversion:: Converting characters or strings and vice versa. | |
1911e6e5 | 299 | * Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}. |
a9f0a989 | 300 | * Case Conversion:: Case conversion functions. |
a44af9f2 RS |
301 | |
302 | Lists | |
303 | ||
304 | * Cons Cells:: How lists are made out of cons cells. | |
305 | * Lists as Boxes:: Graphical notation to explain lists. | |
306 | * List-related Predicates:: Is this object a list? Comparing two lists. | |
307 | * List Elements:: Extracting the pieces of a list. | |
308 | * Building Lists:: Creating list structure. | |
309 | * Modifying Lists:: Storing new pieces into an existing list. | |
310 | * Sets And Lists:: A list can represent a finite mathematical set. | |
311 | * Association Lists:: A list can represent a finite relation or mapping. | |
312 | ||
313 | Modifying Existing List Structure | |
314 | ||
315 | * Setcar:: Replacing an element in a list. | |
316 | * Setcdr:: Replacing part of the list backbone. | |
317 | This can be used to remove or add elements. | |
318 | * Rearrangement:: Reordering the elements in a list; combining lists. | |
319 | ||
320 | Sequences, Arrays, and Vectors | |
321 | ||
322 | * Sequence Functions:: Functions that accept any kind of sequence. | |
323 | * Arrays:: Characteristics of arrays in Emacs Lisp. | |
324 | * Array Functions:: Functions specifically for arrays. | |
325 | * Vectors:: Functions specifically for vectors. | |
326 | ||
327 | Symbols | |
328 | ||
329 | * Symbol Components:: Symbols have names, values, function definitions | |
330 | and property lists. | |
331 | * Definitions:: A definition says how a symbol will be used. | |
332 | * Creating Symbols:: How symbols are kept unique. | |
333 | * Property Lists:: Each symbol has a property list | |
334 | for recording miscellaneous information. | |
335 | ||
336 | Evaluation | |
337 | ||
338 | * Intro Eval:: Evaluation in the scheme of things. | |
339 | * Eval:: How to invoke the Lisp interpreter explicitly. | |
340 | * Forms:: How various sorts of objects are evaluated. | |
341 | * Quoting:: Avoiding evaluation (to put constants in | |
342 | the program). | |
343 | ||
344 | Kinds of Forms | |
345 | ||
346 | * Self-Evaluating Forms:: Forms that evaluate to themselves. | |
347 | * Symbol Forms:: Symbols evaluate as variables. | |
348 | * Classifying Lists:: How to distinguish various sorts of list forms. | |
349 | * Function Forms:: Forms that call functions. | |
350 | * Macro Forms:: Forms that call macros. | |
351 | * Special Forms:: ``Special forms'' are idiosyncratic primitives, | |
352 | most of them extremely important. | |
353 | * Autoloading:: Functions set up to load files | |
354 | containing their real definitions. | |
355 | ||
356 | Control Structures | |
357 | ||
358 | * Sequencing:: Evaluation in textual order. | |
359 | * Conditionals:: @code{if}, @code{cond}. | |
360 | * Combining Conditions:: @code{and}, @code{or}, @code{not}. | |
361 | * Iteration:: @code{while} loops. | |
362 | * Nonlocal Exits:: Jumping out of a sequence. | |
363 | ||
364 | Nonlocal Exits | |
365 | ||
366 | * Catch and Throw:: Nonlocal exits for the program's own purposes. | |
367 | * Examples of Catch:: Showing how such nonlocal exits can be written. | |
368 | * Errors:: How errors are signaled and handled. | |
369 | * Cleanups:: Arranging to run a cleanup form if an | |
370 | error happens. | |
371 | ||
372 | Errors | |
373 | ||
374 | * Signaling Errors:: How to report an error. | |
375 | * Processing of Errors:: What Emacs does when you report an error. | |
376 | * Handling Errors:: How you can trap errors and continue execution. | |
3e099569 | 377 | * Error Symbols:: How errors are classified for trapping them. |
a44af9f2 RS |
378 | |
379 | Variables | |
380 | ||
381 | * Global Variables:: Variable values that exist permanently, everywhere. | |
382 | * Constant Variables:: Certain "variables" have values that never change. | |
383 | * Local Variables:: Variable values that exist only temporarily. | |
384 | * Void Variables:: Symbols that lack values. | |
385 | * Defining Variables:: A definition says a symbol is used as a variable. | |
386 | * Accessing Variables:: Examining values of variables whose names | |
387 | are known only at run time. | |
388 | * Setting Variables:: Storing new values in variables. | |
389 | * Variable Scoping:: How Lisp chooses among local and global values. | |
390 | * Buffer-Local Variables:: Variable values in effect only in one buffer. | |
391 | ||
392 | Scoping Rules for Variable Bindings | |
393 | ||
394 | * Scope:: Scope means where in the program a value | |
395 | is visible. Comparison with other languages. | |
396 | * Extent:: Extent means how long in time a value exists. | |
397 | * Impl of Scope:: Two ways to implement dynamic scoping. | |
398 | * Using Scoping:: How to use dynamic scoping carefully and | |
399 | avoid problems. | |
400 | ||
401 | Buffer-Local Variables | |
402 | ||
403 | * Intro to Buffer-Local:: Introduction and concepts. | |
404 | * Creating Buffer-Local:: Creating and destroying buffer-local bindings. | |
405 | * Default Value:: The default value is seen in buffers | |
cc236dfe | 406 | that don't have their own buffer-local values. |
a44af9f2 RS |
407 | |
408 | Functions | |
409 | ||
410 | * What Is a Function:: Lisp functions vs primitives; terminology. | |
411 | * Lambda Expressions:: How functions are expressed as Lisp objects. | |
412 | * Function Names:: A symbol can serve as the name of a function. | |
413 | * Defining Functions:: Lisp expressions for defining functions. | |
414 | * Calling Functions:: How to use an existing function. | |
415 | * Mapping Functions:: Applying a function to each element of a list, etc. | |
416 | * Anonymous Functions:: Lambda-expressions are functions with no names. | |
417 | * Function Cells:: Accessing or setting the function definition | |
418 | of a symbol. | |
419 | * Related Topics:: Cross-references to specific Lisp primitives | |
420 | that have a special bearing on how | |
421 | functions work. | |
422 | ||
423 | Lambda Expressions | |
424 | ||
425 | * Lambda Components:: The parts of a lambda expression. | |
426 | * Simple Lambda:: A simple example. | |
427 | * Argument List:: Details and special features of argument lists. | |
428 | * Function Documentation:: How to put documentation in a function. | |
429 | ||
430 | Macros | |
431 | ||
432 | * Simple Macro:: A basic example. | |
433 | * Expansion:: How, when and why macros are expanded. | |
434 | * Compiling Macros:: How macros are expanded by the compiler. | |
435 | * Defining Macros:: How to write a macro definition. | |
436 | * Backquote:: Easier construction of list structure. | |
437 | * Problems with Macros:: Don't evaluate the macro arguments too many times. | |
438 | Don't hide the user's variables. | |
439 | ||
440 | Loading | |
441 | ||
442 | * How Programs Do Loading:: The @code{load} function and others. | |
443 | * Autoload:: Setting up a function to autoload. | |
bfe721d1 | 444 | * Named Features:: Loading a library if it isn't already loaded. |
a44af9f2 RS |
445 | * Repeated Loading:: Precautions about loading a file twice. |
446 | ||
447 | Byte Compilation | |
448 | ||
449 | * Compilation Functions:: Byte compilation functions. | |
450 | * Disassembly:: Disassembling byte-code; how to read byte-code. | |
451 | ||
a9f0a989 RS |
452 | Advising Functions |
453 | ||
454 | * Simple Advice:: A simple example to explain the basics of advice. | |
455 | * Defining Advice:: Detailed description of @code{defadvice}. | |
456 | * Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}. | |
457 | * Activation of Advice:: Advice doesn't do anything until you activate it. | |
458 | * Enabling Advice:: You can enable or disable each piece of advice. | |
459 | * Preactivation:: Preactivation is a way of speeding up the | |
460 | loading of compiled advice. | |
1911e6e5 | 461 | * Argument Access in Advice:: How advice can access the function's arguments. |
a9f0a989 RS |
462 | * Subr Arguments:: Accessing arguments when advising a primitive. |
463 | * Combined Definition:: How advice is implemented. | |
464 | ||
a44af9f2 RS |
465 | Debugging Lisp Programs |
466 | ||
467 | * Debugger:: How the Emacs Lisp debugger is implemented. | |
468 | * Syntax Errors:: How to find syntax errors. | |
469 | * Compilation Errors:: How to find errors that show up in | |
470 | byte compilation. | |
471 | * Edebug:: A source-level Emacs Lisp debugger. | |
472 | ||
473 | The Lisp Debugger | |
474 | ||
475 | * Error Debugging:: Entering the debugger when an error happens. | |
476 | * Function Debugging:: Entering it when a certain function is called. | |
477 | * Explicit Debug:: Entering it at a certain point in the program. | |
478 | * Using Debugger:: What the debugger does; what you see while in it. | |
479 | * Debugger Commands:: Commands used while in the debugger. | |
480 | * Invoking the Debugger:: How to call the function @code{debug}. | |
481 | * Internals of Debugger:: Subroutines of the debugger, and global variables. | |
482 | ||
483 | Debugging Invalid Lisp Syntax | |
484 | ||
485 | * Excess Open:: How to find a spurious open paren or missing close. | |
486 | * Excess Close:: How to find a spurious close paren or missing open. | |
487 | ||
488 | Reading and Printing Lisp Objects | |
489 | ||
490 | * Streams Intro:: Overview of streams, reading and printing. | |
491 | * Input Streams:: Various data types that can be used as | |
492 | input streams. | |
493 | * Input Functions:: Functions to read Lisp objects from text. | |
494 | * Output Streams:: Various data types that can be used as | |
495 | output streams. | |
496 | * Output Functions:: Functions to print Lisp objects as text. | |
497 | ||
498 | Minibuffers | |
499 | ||
500 | * Intro to Minibuffers:: Basic information about minibuffers. | |
501 | * Text from Minibuffer:: How to read a straight text string. | |
502 | * Object from Minibuffer:: How to read a Lisp object or expression. | |
503 | * Completion:: How to invoke and customize completion. | |
504 | * Yes-or-No Queries:: Asking a question with a simple answer. | |
505 | * Minibuffer Misc:: Various customization hooks and variables. | |
506 | ||
507 | Completion | |
508 | ||
509 | * Basic Completion:: Low-level functions for completing strings. | |
510 | (These are too low level to use the minibuffer.) | |
511 | * Minibuffer Completion:: Invoking the minibuffer with completion. | |
512 | * Completion Commands:: Minibuffer commands that do completion. | |
513 | * High-Level Completion:: Convenient special cases of completion | |
514 | (reading buffer name, file name, etc.) | |
515 | * Reading File Names:: Using completion to read file names. | |
516 | * Programmed Completion:: Finding the completions for a given file name. | |
517 | ||
518 | Command Loop | |
519 | ||
520 | * Command Overview:: How the command loop reads commands. | |
521 | * Defining Commands:: Specifying how a function should read arguments. | |
522 | * Interactive Call:: Calling a command, so that it will read arguments. | |
523 | * Command Loop Info:: Variables set by the command loop for you to examine. | |
524 | * Input Events:: What input looks like when you read it. | |
525 | * Reading Input:: How to read input events from the keyboard or mouse. | |
526 | * Waiting:: Waiting for user input or elapsed time. | |
527 | * Quitting:: How @kbd{C-g} works. How to catch or defer quitting. | |
528 | * Prefix Command Arguments:: How the commands to set prefix args work. | |
529 | * Recursive Editing:: Entering a recursive edit, | |
530 | and why you usually shouldn't. | |
531 | * Disabling Commands:: How the command loop handles disabled commands. | |
532 | * Command History:: How the command history is set up, and how accessed. | |
533 | * Keyboard Macros:: How keyboard macros are implemented. | |
534 | ||
535 | Defining Commands | |
536 | ||
537 | * Using Interactive:: General rules for @code{interactive}. | |
538 | * Interactive Codes:: The standard letter-codes for reading arguments | |
539 | in various ways. | |
540 | * Interactive Examples:: Examples of how to read interactive arguments. | |
541 | ||
542 | Keymaps | |
543 | ||
544 | * Keymap Terminology:: Definitions of terms pertaining to keymaps. | |
545 | * Format of Keymaps:: What a keymap looks like as a Lisp object. | |
546 | * Creating Keymaps:: Functions to create and copy keymaps. | |
547 | * Inheritance and Keymaps:: How one keymap can inherit the bindings | |
548 | of another keymap. | |
549 | * Prefix Keys:: Defining a key with a keymap as its definition. | |
550 | * Menu Keymaps:: A keymap can define a menu for X windows | |
551 | or for use from the terminal. | |
552 | * Active Keymaps:: Each buffer has a local keymap | |
553 | to override the standard (global) bindings. | |
554 | Each minor mode can also override them. | |
555 | * Key Lookup:: How extracting elements from keymaps works. | |
556 | * Functions for Key Lookup:: How to request key lookup. | |
557 | * Changing Key Bindings:: Redefining a key in a keymap. | |
558 | * Key Binding Commands:: Interactive interfaces for redefining keys. | |
559 | * Scanning Keymaps:: Looking through all keymaps, for printing help. | |
560 | ||
561 | Major and Minor Modes | |
562 | ||
563 | * Major Modes:: Defining major modes. | |
564 | * Minor Modes:: Defining minor modes. | |
565 | * Mode Line Format:: Customizing the text that appears in the mode line. | |
566 | * Hooks:: How to use hooks; how to write code that | |
567 | provides hooks. | |
568 | ||
569 | Major Modes | |
570 | ||
571 | * Major Mode Conventions:: Coding conventions for keymaps, etc. | |
572 | * Example Major Modes:: Text mode and Lisp modes. | |
573 | * Auto Major Mode:: How Emacs chooses the major mode automatically. | |
574 | * Mode Help:: Finding out how to use a mode. | |
575 | ||
576 | Minor Modes | |
577 | ||
578 | * Minor Mode Conventions:: Tips for writing a minor mode. | |
579 | * Keymaps and Minor Modes:: How a minor mode can have its own keymap. | |
580 | ||
581 | Mode Line Format | |
582 | ||
583 | * Mode Line Data:: The data structure that controls the mode line. | |
584 | * Mode Line Variables:: Variables used in that data structure. | |
585 | * %-Constructs:: Putting information into a mode line. | |
586 | ||
587 | Documentation | |
588 | ||
589 | * Documentation Basics:: Good style for doc strings. | |
590 | Where to put them. How Emacs stores them. | |
591 | * Accessing Documentation:: How Lisp programs can access doc strings. | |
592 | * Keys in Documentation:: Substituting current key bindings. | |
593 | * Describing Characters:: Making printable descriptions of | |
594 | non-printing characters and key sequences. | |
595 | * Help Functions:: Subroutines used by Emacs help facilities. | |
596 | ||
597 | Files | |
598 | ||
599 | * Visiting Files:: Reading files into Emacs buffers for editing. | |
600 | * Saving Buffers:: Writing changed buffers back into files. | |
601 | * Reading from Files:: Reading files into other buffers. | |
602 | * Writing to Files:: Writing new files from parts of buffers. | |
603 | * File Locks:: Locking and unlocking files, to prevent | |
604 | simultaneous editing by two people. | |
605 | * Information about Files:: Testing existence, accessibility, size of files. | |
606 | * Contents of Directories:: Getting a list of the files in a directory. | |
f9f59935 RS |
607 | * Changing Files:: Renaming files, changing protection, etc. |
608 | * File Names:: Decomposing and expanding file names. | |
a44af9f2 RS |
609 | |
610 | Visiting Files | |
611 | ||
612 | * Visiting Functions:: The usual interface functions for visiting. | |
613 | * Subroutines of Visiting:: Lower-level subroutines that they use. | |
614 | ||
615 | Information about Files | |
616 | ||
617 | * Testing Accessibility:: Is a given file readable? Writable? | |
618 | * Kinds of Files:: Is it a directory? A link? | |
619 | * File Attributes:: How large is it? Any other names? Etc. | |
620 | ||
621 | File Names | |
622 | ||
623 | * File Name Components:: The directory part of a file name, and the rest. | |
624 | * Directory Names:: A directory's name as a directory | |
625 | is different from its name as a file. | |
626 | * Relative File Names:: Some file names are relative to a | |
627 | current directory. | |
628 | * File Name Expansion:: Converting relative file names to absolute ones. | |
629 | * Unique File Names:: Generating names for temporary files. | |
630 | * File Name Completion:: Finding the completions for a given file name. | |
631 | ||
632 | Backups and Auto-Saving | |
633 | ||
634 | * Backup Files:: How backup files are made; how their names | |
635 | are chosen. | |
636 | * Auto-Saving:: How auto-save files are made; how their | |
637 | names are chosen. | |
638 | * Reverting:: @code{revert-buffer}, and how to customize | |
639 | what it does. | |
640 | ||
641 | Backup Files | |
642 | ||
643 | * Making Backups:: How Emacs makes backup files, and when. | |
644 | * Rename or Copy:: Two alternatives: renaming the old file | |
645 | or copying it. | |
646 | * Numbered Backups:: Keeping multiple backups for each source file. | |
647 | * Backup Names:: How backup file names are computed; customization. | |
648 | ||
649 | Buffers | |
650 | ||
651 | * Buffer Basics:: What is a buffer? | |
652 | * Buffer Names:: Accessing and changing buffer names. | |
653 | * Buffer File Name:: The buffer file name indicates which file | |
654 | is visited. | |
655 | * Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved. | |
656 | * Modification Time:: Determining whether the visited file was changed | |
657 | ``behind Emacs's back''. | |
658 | * Read Only Buffers:: Modifying text is not allowed in a | |
659 | read-only buffer. | |
660 | * The Buffer List:: How to look at all the existing buffers. | |
661 | * Creating Buffers:: Functions that create buffers. | |
662 | * Killing Buffers:: Buffers exist until explicitly killed. | |
663 | * Current Buffer:: Designating a buffer as current | |
664 | so primitives will access its contents. | |
665 | ||
666 | Windows | |
667 | ||
668 | * Basic Windows:: Basic information on using windows. | |
669 | * Splitting Windows:: Splitting one window into two windows. | |
670 | * Deleting Windows:: Deleting a window gives its space to other windows. | |
671 | * Selecting Windows:: The selected window is the one that you edit in. | |
672 | * Cyclic Window Ordering:: Moving around the existing windows. | |
673 | * Buffers and Windows:: Each window displays the contents of a buffer. | |
674 | * Displaying Buffers:: Higher-lever functions for displaying a buffer | |
675 | and choosing a window for it. | |
676 | * Window Point:: Each window has its own location of point. | |
677 | * Window Start:: The display-start position controls which text | |
678 | is on-screen in the window. | |
679 | * Vertical Scrolling:: Moving text up and down in the window. | |
680 | * Horizontal Scrolling:: Moving text sideways on the window. | |
681 | * Size of Window:: Accessing the size of a window. | |
682 | * Resizing Windows:: Changing the size of a window. | |
683 | * Window Configurations:: Saving and restoring the state of the screen. | |
684 | ||
bfe721d1 KH |
685 | Frames |
686 | ||
687 | * Creating Frames:: Creating additional frames. | |
688 | * Multiple Displays:: Creating frames on other X displays. | |
689 | * Frame Parameters:: Controlling frame size, position, font, etc. | |
690 | * Frame Titles:: Automatic updating of frame titles. | |
691 | * Deleting Frames:: Frames last until explicitly deleted. | |
692 | * Finding All Frames:: How to examine all existing frames. | |
693 | * Frames and Windows:: A frame contains windows; | |
694 | display of text always works through windows. | |
695 | * Minibuffers and Frames:: How a frame finds the minibuffer to use. | |
696 | * Input Focus:: Specifying the selected frame. | |
697 | * Visibility of Frames:: Frames may be visible or invisible, or icons. | |
698 | * Raising and Lowering:: Raising a frame makes it hide other X windows; | |
1911e6e5 | 699 | lowering it puts it underneath the others. |
bfe721d1 KH |
700 | * Frame Configurations:: Saving the state of all frames. |
701 | * Mouse Tracking:: Getting events that say when the mouse moves. | |
702 | * Mouse Position:: Asking where the mouse is, or moving it. | |
703 | * Pop-Up Menus:: Displaying a menu for the user to select from. | |
704 | * Dialog Boxes:: Displaying a box to ask yes or no. | |
705 | * Pointer Shapes:: Specifying the shape of the mouse pointer. | |
ebc6903b | 706 | * Window System Selections::Transferring text to and from other windows. |
bfe721d1 KH |
707 | * Color Names:: Getting the definitions of color names. |
708 | * Resources:: Getting resource values from the server. | |
709 | * Server Data:: Getting info about the X server. | |
710 | ||
a44af9f2 RS |
711 | Positions |
712 | ||
713 | * Point:: The special position where editing takes place. | |
714 | * Motion:: Changing point. | |
715 | * Excursions:: Temporary motion and buffer changes. | |
716 | * Narrowing:: Restricting editing to a portion of the buffer. | |
717 | ||
718 | Motion | |
719 | ||
720 | * Character Motion:: Moving in terms of characters. | |
721 | * Word Motion:: Moving in terms of words. | |
722 | * Buffer End Motion:: Moving to the beginning or end of the buffer. | |
723 | * Text Lines:: Moving in terms of lines of text. | |
724 | * Screen Lines:: Moving in terms of lines as displayed. | |
a44af9f2 RS |
725 | * List Motion:: Moving by parsing lists and sexps. |
726 | * Skipping Characters:: Skipping characters belonging to a certain set. | |
727 | ||
728 | Markers | |
729 | ||
730 | * Overview of Markers:: The components of a marker, and how it relocates. | |
731 | * Predicates on Markers:: Testing whether an object is a marker. | |
732 | * Creating Markers:: Making empty markers or markers at certain places. | |
733 | * Information from Markers:: Finding the marker's buffer or character | |
734 | position. | |
f9f59935 | 735 | * Moving Markers:: Moving the marker to a new buffer or position. |
a44af9f2 RS |
736 | * The Mark:: How ``the mark'' is implemented with a marker. |
737 | * The Region:: How to access ``the region''. | |
738 | ||
739 | Text | |
740 | ||
741 | * Near Point:: Examining text in the vicinity of point. | |
742 | * Buffer Contents:: Examining text in a general fashion. | |
743 | * Insertion:: Adding new text to a buffer. | |
744 | * Commands for Insertion:: User-level commands to insert text. | |
745 | * Deletion:: Removing text from a buffer. | |
746 | * User-Level Deletion:: User-level commands to delete text. | |
747 | * The Kill Ring:: Where removed text sometimes is saved for | |
748 | later use. | |
749 | * Undo:: Undoing changes to the text of a buffer. | |
750 | * Auto Filling:: How auto-fill mode is implemented to break lines. | |
751 | * Filling:: Functions for explicit filling. | |
bfe721d1 | 752 | * Margins:: How to specify margins for filling commands. |
a44af9f2 RS |
753 | * Sorting:: Functions for sorting parts of the buffer. |
754 | * Indentation:: Functions to insert or adjust indentation. | |
755 | * Columns:: Computing horizontal positions, and using them. | |
756 | * Case Changes:: Case conversion of parts of the buffer. | |
840797ee | 757 | * Text Properties:: Assigning Lisp property lists to text characters. |
a44af9f2 | 758 | * Substitution:: Replacing a given character wherever it appears. |
840797ee | 759 | * Transposition:: Swapping two portions of a buffer. |
a44af9f2 RS |
760 | * Registers:: How registers are implemented. Accessing |
761 | the text or position stored in a register. | |
840797ee | 762 | * Change Hooks:: Supplying functions to be run when text is changed. |
a44af9f2 RS |
763 | |
764 | The Kill Ring | |
765 | ||
766 | * Kill Ring Concepts:: What text looks like in the kill ring. | |
767 | * Kill Functions:: Functions that kill text. | |
768 | * Yank Commands:: Commands that access the kill ring. | |
22697dac | 769 | * Low-Level Kill Ring:: Functions and variables for kill ring access. |
a44af9f2 RS |
770 | * Internals of Kill Ring:: Variables that hold kill-ring data. |
771 | ||
772 | Indentation | |
773 | ||
774 | * Primitive Indent:: Functions used to count and insert indentation. | |
775 | * Mode-Specific Indent:: Customize indentation for different modes. | |
776 | * Region Indent:: Indent all the lines in a region. | |
777 | * Relative Indent:: Indent the current line based on previous lines. | |
778 | * Indent Tabs:: Adjustable, typewriter-like tab stops. | |
779 | * Motion by Indent:: Move to first non-blank character. | |
780 | ||
840797ee KH |
781 | Text Properties |
782 | ||
783 | * Examining Properties:: Looking at the properties of one character. | |
784 | * Changing Properties:: Setting the properties of a range of text. | |
785 | * Property Search:: Searching for where a property changes value. | |
786 | * Special Properties:: Particular properties with special meanings. | |
787 | * Format Properties:: Properties for representing formatting of text. | |
788 | * Sticky Properties:: How inserted text gets properties from | |
789 | neighboring text. | |
790 | * Saving Properties:: Saving text properties in files, and reading | |
791 | them back. | |
792 | * Lazy Properties:: Computing text properties in a lazy fashion | |
793 | only when text is examined. | |
794 | * Not Intervals:: Why text properties do not use | |
795 | Lisp-visible text intervals. | |
796 | ||
a44af9f2 RS |
797 | Searching and Matching |
798 | ||
799 | * String Search:: Search for an exact match. | |
800 | * Regular Expressions:: Describing classes of strings. | |
801 | * Regexp Search:: Searching for a match for a regexp. | |
802 | * Match Data:: Finding out which part of the text matched | |
803 | various parts of a regexp, after regexp search. | |
804 | * Saving Match Data:: Saving and restoring this information. | |
805 | * Standard Regexps:: Useful regexps for finding sentences, pages,... | |
806 | * Searching and Case:: Case-independent or case-significant searching. | |
807 | ||
808 | Regular Expressions | |
809 | ||
810 | * Syntax of Regexps:: Rules for writing regular expressions. | |
811 | * Regexp Example:: Illustrates regular expression syntax. | |
812 | ||
813 | Syntax Tables | |
814 | ||
815 | * Syntax Descriptors:: How characters are classified. | |
816 | * Syntax Table Functions:: How to create, examine and alter syntax tables. | |
817 | * Parsing Expressions:: Parsing balanced expressions | |
818 | using the syntax table. | |
819 | * Standard Syntax Tables:: Syntax tables used by various major modes. | |
820 | * Syntax Table Internals:: How syntax table information is stored. | |
821 | ||
822 | Syntax Descriptors | |
823 | ||
824 | * Syntax Class Table:: Table of syntax classes. | |
825 | * Syntax Flags:: Additional flags each character can have. | |
826 | ||
827 | Abbrevs And Abbrev Expansion | |
828 | ||
829 | * Abbrev Mode:: Setting up Emacs for abbreviation. | |
830 | * Tables: Abbrev Tables. Creating and working with abbrev tables. | |
831 | * Defining Abbrevs:: Specifying abbreviations and their expansions. | |
832 | * Files: Abbrev Files. Saving abbrevs in files. | |
833 | * Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines. | |
834 | * Standard Abbrev Tables:: Abbrev tables used by various major modes. | |
835 | ||
836 | Processes | |
837 | ||
838 | * Subprocess Creation:: Functions that start subprocesses. | |
839 | * Synchronous Processes:: Details of using synchronous subprocesses. | |
840 | * Asynchronous Processes:: Starting up an asynchronous subprocess. | |
841 | * Deleting Processes:: Eliminating an asynchronous subprocess. | |
842 | * Process Information:: Accessing run-status and other attributes. | |
843 | * Input to Processes:: Sending input to an asynchronous subprocess. | |
844 | * Signals to Processes:: Stopping, continuing or interrupting | |
845 | an asynchronous subprocess. | |
846 | * Output from Processes:: Collecting output from an asynchronous subprocess. | |
847 | * Sentinels:: Sentinels run when process run-status changes. | |
bfe721d1 | 848 | * Network:: Opening network connections. |
a44af9f2 RS |
849 | |
850 | Receiving Output from Processes | |
851 | ||
852 | * Process Buffers:: If no filter, output is put in a buffer. | |
853 | * Filter Functions:: Filter functions accept output from the process. | |
854 | * Accepting Output:: How to wait until process output arrives. | |
855 | ||
856 | Operating System Interface | |
857 | ||
858 | * Starting Up:: Customizing Emacs start-up processing. | |
859 | * Getting Out:: How exiting works (permanent or temporary). | |
860 | * System Environment:: Distinguish the name and kind of system. | |
861 | * Terminal Input:: Recording terminal input for debugging. | |
862 | * Terminal Output:: Recording terminal output for debugging. | |
863 | * Flow Control:: How to turn output flow control on or off. | |
864 | * Batch Mode:: Running Emacs without terminal interaction. | |
865 | ||
866 | Starting Up Emacs | |
867 | ||
868 | * Start-up Summary:: Sequence of actions Emacs performs at start-up. | |
869 | * Init File:: Details on reading the init file (@file{.emacs}). | |
870 | * Terminal-Specific:: How the terminal-specific Lisp file is read. | |
871 | * Command Line Arguments:: How command line arguments are processed, | |
872 | and how you can customize them. | |
873 | ||
874 | Getting out of Emacs | |
875 | ||
876 | * Killing Emacs:: Exiting Emacs irreversibly. | |
877 | * Suspending Emacs:: Exiting Emacs reversibly. | |
878 | ||
879 | Emacs Display | |
880 | ||
881 | * Refresh Screen:: Clearing the screen and redrawing everything on it. | |
882 | * Truncation:: Folding or wrapping long text lines. | |
883 | * The Echo Area:: Where messages are displayed. | |
884 | * Selective Display:: Hiding part of the buffer text. | |
885 | * Overlay Arrow:: Display of an arrow to indicate position. | |
886 | * Temporary Displays:: Displays that go away automatically. | |
887 | * Waiting:: Forcing display update and waiting for user. | |
888 | * Blinking:: How Emacs shows the matching open parenthesis. | |
889 | * Usual Display:: How control characters are displayed. | |
890 | * Beeping:: Audible signal to the user. | |
891 | * Window Systems:: Which window system is being used. | |
892 | ||
893 | GNU Emacs Internals | |
894 | ||
895 | * Building Emacs:: How to preload Lisp libraries into Emacs. | |
896 | * Pure Storage:: A kludge to make preloaded Lisp functions sharable. | |
897 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | |
898 | * Object Internals:: Data formats of buffers, windows, processes. | |
899 | * Writing Emacs Primitives:: Writing C code for Emacs. | |
900 | ||
901 | Object Internals | |
902 | ||
903 | * Buffer Internals:: Components of a buffer structure. | |
904 | * Window Internals:: Components of a window structure. | |
905 | * Process Internals:: Components of a process structure. | |
906 | @end menu | |
907 | ||
908 | @include intro.texi | |
909 | @include objects.texi | |
910 | @include numbers.texi | |
911 | @include strings.texi | |
912 | ||
913 | @include lists.texi | |
914 | @include sequences.texi | |
915 | @include symbols.texi | |
916 | @include eval.texi | |
917 | ||
918 | @include control.texi | |
919 | @include variables.texi | |
920 | @include functions.texi | |
921 | @include macros.texi | |
922 | ||
f9f59935 | 923 | @include customize.texi |
a44af9f2 RS |
924 | @include loading.texi |
925 | @include compile.texi | |
cc236dfe | 926 | @include advice.texi |
a44af9f2 | 927 | |
cc236dfe | 928 | @include debugging.texi |
f9f59935 | 929 | @include streams.texi |
a44af9f2 RS |
930 | @include minibuf.texi |
931 | @include commands.texi | |
a44af9f2 | 932 | |
cc236dfe | 933 | @include keymaps.texi |
f9f59935 | 934 | @include modes.texi |
a44af9f2 RS |
935 | @include help.texi |
936 | @include files.texi | |
a44af9f2 | 937 | |
cc236dfe | 938 | @include backups.texi |
f9f59935 | 939 | @include buffers.texi |
a44af9f2 RS |
940 | @include windows.texi |
941 | @include frames.texi | |
f9f59935 | 942 | |
cc236dfe | 943 | @include positions.texi |
a44af9f2 RS |
944 | @include markers.texi |
945 | @include text.texi | |
f9f59935 | 946 | @include nonascii.texi |
f9f59935 | 947 | |
cc236dfe | 948 | @include searching.texi |
a44af9f2 RS |
949 | @include syntax.texi |
950 | @include abbrevs.texi | |
a44af9f2 | 951 | @include processes.texi |
f9f59935 | 952 | |
cc236dfe | 953 | @include os.texi |
a44af9f2 RS |
954 | @include display.texi |
955 | @include calendar.texi | |
956 | ||
957 | @c MOVE to Emacs Manual: include misc-modes.texi | |
958 | ||
959 | @c appendices | |
960 | ||
961 | @c REMOVE this: include non-hacker.texi | |
962 | ||
963 | @include tips.texi | |
964 | @include internals.texi | |
965 | @include errors.texi | |
966 | @include locals.texi | |
967 | @include maps.texi | |
968 | @include hooks.texi | |
a44af9f2 RS |
969 | |
970 | @include index.texi | |
971 | ||
f9f59935 | 972 | @node New Symbols, , Index, Top |
a9f0a989 | 973 | @unnumbered New Symbols Since the Previous Edition |
f9f59935 | 974 | |
cc236dfe | 975 | @printindex tp |
f9f59935 | 976 | |
a44af9f2 RS |
977 | @c Print the tables of contents |
978 | @summarycontents | |
979 | @contents | |
980 | @c That's all | |
981 | ||
982 | @bye | |
983 | ||
984 | \f | |
985 | These words prevent "local variables" above from confusing Emacs. |