1 \input texinfo @c -*-texinfo-*-
3 @setfilename ../../info/lispref.info
5 @settitle XEmacs Lisp Reference Manual
9 @dircategory XEmacs Editor
11 * Lispref: (lispref). XEmacs Lisp Reference Manual.
16 GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993
17 GNU Emacs Lisp Reference Manual Further Revised (v2.02), August 1993
18 Lucid Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
19 XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
20 GNU Emacs Lisp Reference Manual v2.4, June 1995
21 XEmacs Lisp Programmer's Manual (for 19.13) Third Edition, July 1995
22 XEmacs Lisp Reference Manual (for 19.14 and 20.0) v3.1, March 1996
23 XEmacs Lisp Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May, November 1997
24 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998
25 @c Please REMEMBER to update edition number in *four* places in this file
26 @c and also in *one* place in intro.texi
28 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
29 Copyright (C) 1994, 1995 Sun Microsystems, Inc.
30 Copyright (C) 1995, 1996 Ben Wing.
33 Permission is granted to make and distribute verbatim copies of this
34 manual provided the copyright notice and this permission notice are
35 preserved on all copies.
38 Permission is granted to process this file through TeX and print the
39 results, provided the printed document carries copying permission notice
40 identical to this one except for the removal of this paragraph (this
41 paragraph not being relevant to the printed manual).
44 Permission is granted to copy and distribute modified versions of this
45 manual under the conditions for verbatim copying, provided that the
46 entire resulting derived work is distributed under the terms of a
47 permission notice identical to this one.
49 Permission is granted to copy and distribute translations of this manual
50 into another language, under the above conditions for modified versions,
51 except that this permission notice may be stated in a translation
52 approved by the Foundation.
54 Permission is granted to copy and distribute modified versions of this
55 manual under the conditions for verbatim copying, provided also that the
56 section entitled ``GNU General Public License'' is included exactly as
57 in the original, and provided that the entire resulting derived work is
58 distributed under the terms of a permission notice identical to this
61 Permission is granted to copy and distribute translations of this manual
62 into another language, under the above conditions for modified versions,
63 except that the section entitled ``GNU General Public License'' may be
64 included in a translation approved by the Free Software Foundation
65 instead of in the original English.
75 @setchapternewpage odd
79 @title XEmacs Lisp Reference Manual
80 @c The edition number appears in several places in this file
81 @c and also in the file intro.texi.
82 @c This manual documents XEmacs 19.14 and 20.0 and was based on the
83 @c documentation for FSF Emacs 19.29 (v2.4).
84 @subtitle Version 3.3 (for XEmacs 21.0), April 1998
88 @author Based on the GNU Emacs Lisp Reference Manual
89 @author by Bil Lewis, Dan LaLiberte, Richard Stallman
90 @author and the GNU Manual Group
92 @vskip 0pt plus 1filll
93 Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
94 Copyright @copyright{} 1994, 1995 Sun Microsystems, Inc.
95 Copyright @copyright{} 1995, 1996 Ben Wing.
98 Revised for XEmacs Versions 21.0,@*
101 Permission is granted to make and distribute verbatim copies of this
102 manual provided the copyright notice and this permission notice are
103 preserved on all copies.
105 Permission is granted to copy and distribute modified versions of this
106 manual under the conditions for verbatim copying, provided also that the
107 section entitled ``GNU General Public License'' is included
108 exactly as in the original, and provided that the entire resulting
109 derived work is distributed under the terms of a permission notice
110 identical to this one.
112 Permission is granted to copy and distribute translations of this manual
113 into another language, under the above conditions for modified versions,
114 except that the section entitled ``GNU General Public License'' may be
115 included in a translation approved by the Free Software Foundation
116 instead of in the original English.
118 Cover art by Etienne Suvasa.
122 @node Top, Copying, (dir), (dir)
125 This Info file contains the third edition of the XEmacs Lisp
126 Reference Manual, corresponding to XEmacs version 21.0.
130 * Copying:: Conditions for copying and changing XEmacs.
131 * Introduction:: Introduction and conventions used.
133 * Packaging:: Lisp library administrative infrastructure.
135 * Lisp Data Types:: Data types of objects in XEmacs Lisp.
136 * Numbers:: Numbers and arithmetic functions.
137 * Strings and Characters:: Strings, and functions that work on them.
138 * Lists:: Lists, cons cells, and related functions.
139 * Sequences Arrays Vectors:: Lists, strings and vectors are called sequences.
140 Certain functions act on any kind of sequence.
141 The description of vectors is here as well.
142 * Symbols:: Symbols represent names, uniquely.
144 * Evaluation:: How Lisp expressions are evaluated.
145 * Control Structures:: Conditionals, loops, nonlocal exits.
146 * Variables:: Using symbols in programs to stand for values.
148 * Functions and Commands:: A function is a Lisp program that can be
149 invoked from other functions.
151 * Macros:: Macros are a way to extend the Lisp language.
152 * Customization:: Writing customization declarations.
154 * Loading:: Reading files of Lisp code into Lisp.
155 * Byte Compilation:: Compilation makes programs run faster.
156 * Debugging:: Tools and tips for debugging Lisp programs.
158 * Read and Print:: Converting Lisp objects to text and back.
159 * Minibuffers:: Using the minibuffer to read input.
160 * Command Loop:: How the editor command loop works,
161 and how you can call its subroutines.
162 * Keymaps:: Defining the bindings from keys to commands.
163 * Menus:: Defining pull-down and pop-up menus.
164 * Dialog Boxes:: Creating dialog boxes.
165 * Toolbar:: Controlling the toolbar.
166 * Gutter:: Controlling the gutter.
167 * Scrollbars:: Controlling the scrollbars.
168 * Drag and Drop:: Generic API to inter-application communication
169 via specific protocols.
170 * Modes:: Defining major and minor modes.
171 * Documentation:: Writing and using documentation strings.
173 * Files:: Accessing files.
174 * Backups and Auto-Saving:: Controlling how backups and auto-save
176 * Buffers:: Creating and using buffer objects.
177 * Windows:: Manipulating windows and displaying buffers.
178 * Frames:: Making multiple X windows.
179 * Consoles and Devices:: Opening frames on multiple TTY's or X displays.
180 * Positions:: Buffer positions and motion functions.
181 * Markers:: Markers represent positions and update
182 automatically when the text is changed.
184 * Text:: Examining and changing text in buffers.
185 * Searching and Matching:: Searching buffers for strings or regexps.
186 * Syntax Tables:: The syntax table controls word and list parsing.
187 * Abbrevs:: How Abbrev mode works, and its data structures.
189 * Extents:: Extents are regions of text with particular
190 display characteristics.
191 * Specifiers:: How faces and glyphs are specified.
192 * Faces and Window-System Objects::
193 A face is a set of display characteristics
194 specifying how text is to be displayed.
195 * Glyphs:: General interface to pixmaps displayed in a
197 * Annotations:: Higher-level interface to glyphs in a buffer.
198 * Display:: Parameters controlling screen usage.
199 The bell. Waiting for input.
201 * Hash Tables:: Fast data structures for mappings.
202 * Range Tables:: Keeping track of ranges of numbers.
203 * Databases:: An interface to standard DBM and DB databases.
205 * Processes:: Running and communicating with subprocesses.
206 * System Interface:: Getting the user id, system type, environment
207 variables, and other such things.
208 * X-Windows:: Functions specific to the X Window System.
209 * ToolTalk Support:: Interfacing with the ToolTalk message service.
210 * LDAP Support:: Interfacing with the Lightweight Directory
212 * PostgreSQL Support:: Interfacing to the PostgreSQL libpq library.
213 * Internationalization:: How Emacs supports different languages and
214 cultural conventions.
215 * MULE:: Specifics of the Asian-language support.
219 * Tips:: Advice for writing Lisp programs.
220 * Building XEmacs and Object Allocation::
221 Behind-the-scenes information about XEmacs.
222 * Standard Errors:: List of all error symbols.
223 * Standard Buffer-Local Variables:: List of variables local in all buffers.
224 * Standard Keymaps:: List of standard keymaps.
225 * Standard Hooks:: List of standard hook variables.
227 * Index:: Index including concepts, functions, variables,
230 --- The Detailed Node Listing ---
232 Here are other nodes that are inferiors of those already listed,
233 mentioned here so you can get to them in one step:
237 * Caveats:: Flaws and a request for help.
238 * Lisp History:: XEmacs Lisp is descended from Maclisp.
239 * Conventions:: How the manual is formatted.
240 * Acknowledgements:: The authors, editors, and sponsors of this manual.
244 * Some Terms:: Explanation of terms we use in this manual.
245 * nil and t:: How the symbols @code{nil} and @code{t} are used.
246 * Evaluation Notation:: The format we use for examples of evaluation.
247 * Printing Notation:: The format we use for examples that print output.
248 * Error Messages:: The format we use for examples of errors.
249 * Buffer Text Notation:: The format we use for buffer contents in examples.
250 * Format of Descriptions:: Notation for describing functions, variables, etc.
252 Format of Descriptions
254 * A Sample Function Description::
255 * A Sample Variable Description::
259 * Package Overview:: Lisp Libraries and Packages.
260 * Package Terminology:: Basic stuff.
261 * Building Packages:: Turn packaged source into a tarball.
262 * Local.rules File:: Tell the XEmacs Packaging System about your host.
263 * Creating Packages:: Tell the XEmacs Packaging System about your package.
269 * The Library Maintainer View::
270 * The Package Release Engineer View::
272 The Library Maintainer's View
274 * Infrastructure:: Global Makefiles and common rules.
275 * Control Files:: Package-specific Makefiles and administrative files.
276 * Obtaining:: Obtaining the XEmacs Packaging System and utilities.
280 * package-info.in:: package-info.in
281 * Makefile:: @file{Makefile}
286 * Printed Representation:: How Lisp objects are represented as text.
287 * Comments:: Comments and their formatting conventions.
288 * Programming Types:: Types found in all Lisp systems.
289 * Editing Types:: Types specific to XEmacs.
290 * Type Predicates:: Tests related to types.
291 * Equality Predicates:: Tests of equality between any two objects.
295 * Integer Type:: Numbers without fractional parts.
296 * Floating Point Type:: Numbers with fractional parts and with a large range.
297 * Character Type:: The representation of letters, numbers and
299 * Sequence Type:: Both lists and arrays are classified as sequences.
300 * Cons Cell Type:: Cons cells, and lists (which are made from cons cells).
301 * Array Type:: Arrays include strings and vectors.
302 * String Type:: An (efficient) array of characters.
303 * Vector Type:: One-dimensional arrays.
304 * Symbol Type:: A multi-use object that refers to a function,
305 variable, property list, or itself.
306 * Function Type:: A piece of executable code you can call from elsewhere.
307 * Macro Type:: A method of expanding an expression into another
308 expression, more fundamental but less pretty.
309 * Primitive Function Type:: A function written in C, callable from Lisp.
310 * Compiled-Function Type:: A function written in Lisp, then compiled.
311 * Autoload Type:: A type used for automatically loading seldom-used
316 * Dotted Pair Notation:: An alternative syntax for lists.
317 * Association List Type:: A specially constructed list.
321 * Buffer Type:: The basic object of editing.
322 * Window Type:: What makes buffers visible.
323 * Window Configuration Type:: Save what the screen looks like.
324 * Marker Type:: A position in a buffer.
325 * Process Type:: A process running on the underlying OS.
326 * Stream Type:: Receive or send characters.
327 * Keymap Type:: What function a keystroke invokes.
328 * Syntax Table Type:: What a character means.
332 * Integer Basics:: Representation and range of integers.
333 * Float Basics:: Representation and range of floating point.
334 * Predicates on Numbers:: Testing for numbers.
335 * Comparison of Numbers:: Equality and inequality predicates.
336 * Arithmetic Operations:: How to add, subtract, multiply and divide.
337 * Bitwise Operations:: Logical and, or, not, shifting.
338 * Numeric Conversions:: Converting float to integer and vice versa.
339 * Math Functions:: Trig, exponential and logarithmic functions.
340 * Random Numbers:: Obtaining random integers, predictable or not.
342 Strings and Characters
344 * String Basics:: Basic properties of strings and characters.
345 * Predicates for Strings:: Testing whether an object is a string or char.
346 * Creating Strings:: Functions to allocate new strings.
347 * Predicates for Characters:: Testing whether an object is a character.
348 * Character Codes:: Each character has an equivalent integer.
349 * Text Comparison:: Comparing characters or strings.
350 * String Conversion:: Converting characters or strings and vice versa.
351 * Modifying Strings:: Changing characters in a string.
352 * String Properties:: Additional information attached to strings.
353 * Formatting Strings:: @code{format}: XEmacs's analog of @code{printf}.
354 * Character Case:: Case conversion functions.
355 * Char Tables:: Mapping from characters to Lisp objects.
356 * Case Tables:: Customizing case conversion.
360 * Cons Cells:: How lists are made out of cons cells.
361 * Lists as Boxes:: Graphical notation to explain lists.
362 * List-related Predicates:: Is this object a list? Comparing two lists.
363 * List Elements:: Extracting the pieces of a list.
364 * Building Lists:: Creating list structure.
365 * Modifying Lists:: Storing new pieces into an existing list.
366 * Sets And Lists:: A list can represent a finite mathematical set.
367 * Association Lists:: A list can represent a finite relation or mapping.
368 * Property Lists:: A different way to represent a finite mapping.
369 * Weak Lists:: A list with special garbage-collection behavior.
371 Modifying Existing List Structure
373 * Setcar:: Replacing an element in a list.
374 * Setcdr:: Replacing part of the list backbone.
375 This can be used to remove or add elements.
376 * Rearrangement:: Reordering the elements in a list; combining lists.
378 Sequences, Arrays, and Vectors
380 * Sequence Functions:: Functions that accept any kind of sequence.
381 * Arrays:: Characteristics of arrays in XEmacs Lisp.
382 * Array Functions:: Functions specifically for arrays.
383 * Vectors:: Functions specifically for vectors.
387 * Symbol Components:: Symbols have names, values, function definitions
389 * Definitions:: A definition says how a symbol will be used.
390 * Creating Symbols:: How symbols are kept unique.
391 * Symbol Properties:: Each symbol has a property list
392 for recording miscellaneous information.
396 * Intro Eval:: Evaluation in the scheme of things.
397 * Eval:: How to invoke the Lisp interpreter explicitly.
398 * Forms:: How various sorts of objects are evaluated.
399 * Quoting:: Avoiding evaluation (to put constants in
404 * Self-Evaluating Forms:: Forms that evaluate to themselves.
405 * Symbol Forms:: Symbols evaluate as variables.
406 * Classifying Lists:: How to distinguish various sorts of list forms.
407 * Function Forms:: Forms that call functions.
408 * Macro Forms:: Forms that call macros.
409 * Special Forms:: ``Special forms'' are idiosyncratic primitives,
410 most of them extremely important.
411 * Autoloading:: Functions set up to load files
412 containing their real definitions.
416 * Sequencing:: Evaluation in textual order.
417 * Conditionals:: @code{if}, @code{cond}.
418 * Combining Conditions:: @code{and}, @code{or}, @code{not}.
419 * Iteration:: @code{while} loops.
420 * Nonlocal Exits:: Jumping out of a sequence.
424 * Catch and Throw:: Nonlocal exits for the program's own purposes.
425 * Examples of Catch:: Showing how such nonlocal exits can be written.
426 * Errors:: How errors are signaled and handled.
427 * Cleanups:: Arranging to run a cleanup form if an
432 * Signaling Errors:: How to report an error.
433 * Processing of Errors:: What XEmacs does when you report an error.
434 * Handling Errors:: How you can trap errors and continue execution.
435 * Error Symbols:: How errors are classified for trapping them.
439 * Global Variables:: Variable values that exist permanently, everywhere.
440 * Constant Variables:: Certain "variables" have values that never change.
441 * Local Variables:: Variable values that exist only temporarily.
442 * Void Variables:: Symbols that lack values.
443 * Defining Variables:: A definition says a symbol is used as a variable.
444 * Accessing Variables:: Examining values of variables whose names
445 are known only at run time.
446 * Setting Variables:: Storing new values in variables.
447 * Variable Scoping:: How Lisp chooses among local and global values.
448 * Buffer-Local Variables:: Variable values in effect only in one buffer.
450 Scoping Rules for Variable Bindings
452 * Scope:: Scope means where in the program a value
453 is visible. Comparison with other languages.
454 * Extent:: Extent means how long in time a value exists.
455 * Impl of Scope:: Two ways to implement dynamic scoping.
456 * Using Scoping:: How to use dynamic scoping carefully and
459 Buffer-Local Variables
461 * Intro to Buffer-Local:: Introduction and concepts.
462 * Creating Buffer-Local:: Creating and destroying buffer-local bindings.
463 * Default Value:: The default value is seen in buffers
464 that don't have their own local values.
468 * What Is a Function:: Lisp functions vs primitives; terminology.
469 * Lambda Expressions:: How functions are expressed as Lisp objects.
470 * Function Names:: A symbol can serve as the name of a function.
471 * Defining Functions:: Lisp expressions for defining functions.
472 * Calling Functions:: How to use an existing function.
473 * Mapping Functions:: Applying a function to each element of a list, etc.
474 * Anonymous Functions:: Lambda-expressions are functions with no names.
475 * Function Cells:: Accessing or setting the function definition
477 * Related Topics:: Cross-references to specific Lisp primitives
478 that have a special bearing on how
483 * Lambda Components:: The parts of a lambda expression.
484 * Simple Lambda:: A simple example.
485 * Argument List:: Details and special features of argument lists.
486 * Function Documentation:: How to put documentation in a function.
490 * Simple Macro:: A basic example.
491 * Expansion:: How, when and why macros are expanded.
492 * Compiling Macros:: How macros are expanded by the compiler.
493 * Defining Macros:: How to write a macro definition.
494 * Backquote:: Easier construction of list structure.
495 * Problems with Macros:: Don't evaluate the macro arguments too many times.
496 Don't hide the user's variables.
500 * How Programs Do Loading:: The @code{load} function and others.
501 * Autoload:: Setting up a function to autoload.
502 * Named Features:: Loading a library if it isn't already loaded.
503 * Repeated Loading:: Precautions about loading a file twice.
507 * Speed of Byte-Code:: An example of speedup from byte compilation.
508 * Compilation Functions:: Byte compilation functions.
509 * Docs and Compilation:: Dynamic loading of documentation strings.
510 * Dynamic Loading:: Dynamic loading of individual functions.
511 * Eval During Compile:: Code to be evaluated when you compile.
512 * Compiled-Function Objects:: The data type used for byte-compiled functions.
513 * Disassembly:: Disassembling byte-code; how to read byte-code.
514 * Different Behavior:: When compiled code gives different results.
516 Debugging Lisp Programs
518 * Debugger:: How the XEmacs Lisp debugger is implemented.
519 * Syntax Errors:: How to find syntax errors.
520 * Compilation Errors:: How to find errors that show up in
522 * Edebug:: A source-level XEmacs Lisp debugger.
526 * Error Debugging:: Entering the debugger when an error happens.
527 * Function Debugging:: Entering it when a certain function is called.
528 * Explicit Debug:: Entering it at a certain point in the program.
529 * Using Debugger:: What the debugger does; what you see while in it.
530 * Debugger Commands:: Commands used while in the debugger.
531 * Invoking the Debugger:: How to call the function @code{debug}.
532 * Internals of Debugger:: Subroutines of the debugger, and global variables.
534 Debugging Invalid Lisp Syntax
536 * Excess Open:: How to find a spurious open paren or missing close.
537 * Excess Close:: How to find a spurious close paren or missing open.
539 Reading and Printing Lisp Objects
541 * Streams Intro:: Overview of streams, reading and printing.
542 * Input Streams:: Various data types that can be used as
544 * Input Functions:: Functions to read Lisp objects from text.
545 * Output Streams:: Various data types that can be used as
547 * Output Functions:: Functions to print Lisp objects as text.
551 * Intro to Minibuffers:: Basic information about minibuffers.
552 * Text from Minibuffer:: How to read a straight text string.
553 * Object from Minibuffer:: How to read a Lisp object or expression.
554 * Completion:: How to invoke and customize completion.
555 * Yes-or-No Queries:: Asking a question with a simple answer.
556 * Minibuffer Misc:: Various customization hooks and variables.
560 * Basic Completion:: Low-level functions for completing strings.
561 (These are too low level to use the minibuffer.)
562 * Minibuffer Completion:: Invoking the minibuffer with completion.
563 * Completion Commands:: Minibuffer commands that do completion.
564 * High-Level Completion:: Convenient special cases of completion
565 (reading buffer name, file name, etc.)
566 * Reading File Names:: Using completion to read file names.
567 * Programmed Completion:: Finding the completions for a given file name.
571 * Command Overview:: How the command loop reads commands.
572 * Defining Commands:: Specifying how a function should read arguments.
573 * Interactive Call:: Calling a command, so that it will read arguments.
574 * Command Loop Info:: Variables set by the command loop for you to examine.
575 * Events:: What input looks like when you read it.
576 * Reading Input:: How to read input events from the keyboard or mouse.
577 * Waiting:: Waiting for user input or elapsed time.
578 * Quitting:: How @kbd{C-g} works. How to catch or defer quitting.
579 * Prefix Command Arguments:: How the commands to set prefix args work.
580 * Recursive Editing:: Entering a recursive edit,
581 and why you usually shouldn't.
582 * Disabling Commands:: How the command loop handles disabled commands.
583 * Command History:: How the command history is set up, and how accessed.
584 * Keyboard Macros:: How keyboard macros are implemented.
588 * Using Interactive:: General rules for @code{interactive}.
589 * Interactive Codes:: The standard letter-codes for reading arguments
591 * Interactive Examples:: Examples of how to read interactive arguments.
595 * Event Types:: Events come in different types.
596 * Event Contents:: What the contents of each event type are.
597 * Event Predicates:: Querying whether an event is of a
599 * Accessing Mouse Event Positions::
600 Determining where a mouse event occurred,
602 * Accessing Other Event Info:: Accessing non-positional event info.
603 * Working With Events:: Creating, copying, and destroying events.
604 * Converting Events:: Converting between events, keys, and
607 Accessing Mouse Event Positions
609 * Frame-Level Event Position Info::
610 * Window-Level Event Position Info::
611 * Event Text Position Info::
612 * Event Glyph Position Info::
613 * Event Toolbar Position Info::
614 * Other Event Position Info::
618 * Key Sequence Input:: How to read one key sequence.
619 * Reading One Event:: How to read just one event.
620 * Dispatching an Event:: What to do with an event once it has been read.
621 * Quoted Character Input:: Asking the user to specify a character.
622 * Peeking and Discarding:: How to reread or throw away input events.
626 * Keymap Terminology:: Definitions of terms pertaining to keymaps.
627 * Format of Keymaps:: What a keymap looks like as a Lisp object.
628 * Creating Keymaps:: Functions to create and copy keymaps.
629 * Inheritance and Keymaps:: How one keymap can inherit the bindings
631 * Key Sequences:: How to specify key sequences.
632 * Prefix Keys:: Defining a key with a keymap as its definition.
633 * Active Keymaps:: Each buffer has a local keymap
634 to override the standard (global) bindings.
635 Each minor mode can also override them.
636 * Key Lookup:: How extracting elements from keymaps works.
637 * Functions for Key Lookup:: How to request key lookup.
638 * Changing Key Bindings:: Redefining a key in a keymap.
639 * Key Binding Commands:: Interactive interfaces for redefining keys.
640 * Scanning Keymaps:: Looking through all keymaps, for printing help.
641 * Other Keymap Functions:: Miscellaneous keymap functions.
645 * Menu Format:: Format of a menu description.
646 * Menubar Format:: How to specify a menubar.
647 * Menubar:: Functions for controlling the menubar.
648 * Modifying Menus:: Modifying a menu description.
649 * Pop-Up Menus:: Functions for specifying pop-up menus.
650 * Menu Filters:: Filter functions for the default menubar.
651 * Buffers Menu:: The menu that displays the list of buffers.
655 * Dialog Box Format::
656 * Dialog Box Functions::
660 * Toolbar Intro:: An introduction.
661 * Toolbar Descriptor Format:: How to create a toolbar.
662 * Specifying the Toolbar:: Setting a toolbar.
663 * Other Toolbar Variables:: Controlling the size of toolbars.
669 Major and Minor Modes
671 * Major Modes:: Defining major modes.
672 * Minor Modes:: Defining minor modes.
673 * Modeline Format:: Customizing the text that appears in the modeline.
674 * Hooks:: How to use hooks; how to write code that
679 * Major Mode Conventions:: Coding conventions for keymaps, etc.
680 * Example Major Modes:: Text mode and Lisp modes.
681 * Auto Major Mode:: How XEmacs chooses the major mode automatically.
682 * Mode Help:: Finding out how to use a mode.
686 * Minor Mode Conventions:: Tips for writing a minor mode.
687 * Keymaps and Minor Modes:: How a minor mode can have its own keymap.
691 * Modeline Data:: The data structure that controls the modeline.
692 * Modeline Variables:: Variables used in that data structure.
693 * %-Constructs:: Putting information into a modeline.
697 * Documentation Basics:: Good style for doc strings.
698 Where to put them. How XEmacs stores them.
699 * Accessing Documentation:: How Lisp programs can access doc strings.
700 * Keys in Documentation:: Substituting current key bindings.
701 * Describing Characters:: Making printable descriptions of
702 non-printing characters and key sequences.
703 * Help Functions:: Subroutines used by XEmacs help facilities.
707 * Visiting Files:: Reading files into Emacs buffers for editing.
708 * Saving Buffers:: Writing changed buffers back into files.
709 * Reading from Files:: Reading files into other buffers.
710 * Writing to Files:: Writing new files from parts of buffers.
711 * File Locks:: Locking and unlocking files, to prevent
712 simultaneous editing by two people.
713 * Information about Files:: Testing existence, accessibility, size of files.
714 * Contents of Directories:: Getting a list of the files in a directory.
715 * Changing File Attributes:: Renaming files, changing protection, etc.
716 * File Names:: Decomposing and expanding file names.
720 * Visiting Functions:: The usual interface functions for visiting.
721 * Subroutines of Visiting:: Lower-level subroutines that they use.
723 Information about Files
725 * Testing Accessibility:: Is a given file readable? Writable?
726 * Kinds of Files:: Is it a directory? A link?
727 * File Attributes:: How large is it? Any other names? Etc.
731 * File Name Components:: The directory part of a file name, and the rest.
732 * Directory Names:: A directory's name as a directory
733 is different from its name as a file.
734 * Relative File Names:: Some file names are relative to a
736 * File Name Expansion:: Converting relative file names to absolute ones.
737 * Unique File Names:: Generating names for temporary files.
738 * File Name Completion:: Finding the completions for a given file name.
740 Backups and Auto-Saving
742 * Backup Files:: How backup files are made; how their names
744 * Auto-Saving:: How auto-save files are made; how their
746 * Reverting:: @code{revert-buffer}, and how to customize
751 * Making Backups:: How XEmacs makes backup files, and when.
752 * Rename or Copy:: Two alternatives: renaming the old file
754 * Numbered Backups:: Keeping multiple backups for each source file.
755 * Backup Names:: How backup file names are computed; customization.
759 * Buffer Basics:: What is a buffer?
760 * Buffer Names:: Accessing and changing buffer names.
761 * Buffer File Name:: The buffer file name indicates which file
763 * Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
764 * Modification Time:: Determining whether the visited file was changed
765 ``behind XEmacs's back''.
766 * Read Only Buffers:: Modifying text is not allowed in a
768 * The Buffer List:: How to look at all the existing buffers.
769 * Creating Buffers:: Functions that create buffers.
770 * Killing Buffers:: Buffers exist until explicitly killed.
771 * Current Buffer:: Designating a buffer as current
772 so primitives will access its contents.
776 * Basic Windows:: Basic information on using windows.
777 * Splitting Windows:: Splitting one window into two windows.
778 * Deleting Windows:: Deleting a window gives its space to other windows.
779 * Selecting Windows:: The selected window is the one that you edit in.
780 * Cyclic Window Ordering:: Moving around the existing windows.
781 * Buffers and Windows:: Each window displays the contents of a buffer.
782 * Displaying Buffers:: Higher-lever functions for displaying a buffer
783 and choosing a window for it.
784 * Window Point:: Each window has its own location of point.
785 * Window Start:: The display-start position controls which text
786 is on-screen in the window.
787 * Vertical Scrolling:: Moving text up and down in the window.
788 * Horizontal Scrolling:: Moving text sideways on the window.
789 * Size of Window:: Accessing the size of a window.
790 * Resizing Windows:: Changing the size of a window.
791 * Window Configurations:: Saving and restoring the state of the screen.
795 * Creating Frames:: Creating additional frames.
796 * Frame Properties:: Controlling frame size, position, font, etc.
797 * Frame Titles:: Automatic updating of frame titles.
798 * Deleting Frames:: Frames last until explicitly deleted.
799 * Finding All Frames:: How to examine all existing frames.
800 * Frames and Windows:: A frame contains windows;
801 display of text always works through windows.
802 * Minibuffers and Frames:: How a frame finds the minibuffer to use.
803 * Input Focus:: Specifying the selected frame.
804 * Visibility of Frames:: Frames may be visible or invisible, or icons.
805 * Raising and Lowering:: Raising a frame makes it hide other X windows;
806 lowering it makes the others hide them.
807 * Frame Hooks:: Hooks for customizing frame behavior.
811 * Point:: The special position where editing takes place.
812 * Motion:: Changing point.
813 * Excursions:: Temporary motion and buffer changes.
814 * Narrowing:: Restricting editing to a portion of the buffer.
818 * Character Motion:: Moving in terms of characters.
819 * Word Motion:: Moving in terms of words.
820 * Buffer End Motion:: Moving to the beginning or end of the buffer.
821 * Text Lines:: Moving in terms of lines of text.
822 * Screen Lines:: Moving in terms of lines as displayed.
823 * List Motion:: Moving by parsing lists and sexps.
824 * Skipping Characters:: Skipping characters belonging to a certain set.
828 * Overview of Markers:: The components of a marker, and how it relocates.
829 * Predicates on Markers:: Testing whether an object is a marker.
830 * Creating Markers:: Making empty markers or markers at certain places.
831 * Information from Markers:: Finding the marker's buffer or character
833 * Changing Markers:: Moving the marker to a new buffer or position.
834 * The Mark:: How ``the mark'' is implemented with a marker.
835 * The Region:: How to access ``the region''.
839 * Near Point:: Examining text in the vicinity of point.
840 * Buffer Contents:: Examining text in a general fashion.
841 * Comparing Text:: Comparing substrings of buffers.
842 * Insertion:: Adding new text to a buffer.
843 * Commands for Insertion:: User-level commands to insert text.
844 * Deletion:: Removing text from a buffer.
845 * User-Level Deletion:: User-level commands to delete text.
846 * The Kill Ring:: Where removed text sometimes is saved for later use.
847 * Undo:: Undoing changes to the text of a buffer.
848 * Maintaining Undo:: How to enable and disable undo information.
849 How to control how much information is kept.
850 * Filling:: Functions for explicit filling.
851 * Margins:: How to specify margins for filling commands.
852 * Auto Filling:: How auto-fill mode is implemented to break lines.
853 * Sorting:: Functions for sorting parts of the buffer.
854 * Columns:: Computing horizontal positions, and using them.
855 * Indentation:: Functions to insert or adjust indentation.
856 * Case Changes:: Case conversion of parts of the buffer.
857 * Text Properties:: Assigning Lisp property lists to text characters.
858 * Substitution:: Replacing a given character wherever it appears.
859 * Registers:: How registers are implemented. Accessing the text or
860 position stored in a register.
861 * Transposition:: Swapping two portions of a buffer.
862 * Change Hooks:: Supplying functions to be run when text is changed.
866 * Kill Ring Concepts:: What text looks like in the kill ring.
867 * Kill Functions:: Functions that kill text.
868 * Yank Commands:: Commands that access the kill ring.
869 * Low-Level Kill Ring:: Functions and variables for kill ring access.
870 * Internals of Kill Ring:: Variables that hold kill-ring data.
874 * Primitive Indent:: Functions used to count and insert indentation.
875 * Mode-Specific Indent:: Customize indentation for different modes.
876 * Region Indent:: Indent all the lines in a region.
877 * Relative Indent:: Indent the current line based on previous lines.
878 * Indent Tabs:: Adjustable, typewriter-like tab stops.
879 * Motion by Indent:: Move to first non-blank character.
881 Searching and Matching
883 * String Search:: Search for an exact match.
884 * Regular Expressions:: Describing classes of strings.
885 * Regexp Search:: Searching for a match for a regexp.
886 * Match Data:: Finding out which part of the text matched
887 various parts of a regexp, after regexp search.
888 * Saving Match Data:: Saving and restoring this information.
889 * Standard Regexps:: Useful regexps for finding sentences, pages,...
890 * Searching and Case:: Case-independent or case-significant searching.
894 * Syntax of Regexps:: Rules for writing regular expressions.
895 * Regexp Example:: Illustrates regular expression syntax.
899 * Syntax Descriptors:: How characters are classified.
900 * Syntax Table Functions:: How to create, examine and alter syntax tables.
901 * Parsing Expressions:: Parsing balanced expressions
902 using the syntax table.
903 * Standard Syntax Tables:: Syntax tables used by various major modes.
904 * Syntax Table Internals:: How syntax table information is stored.
908 * Syntax Class Table:: Table of syntax classes.
909 * Syntax Flags:: Additional flags each character can have.
911 Abbrevs And Abbrev Expansion
913 * Abbrev Mode:: Setting up XEmacs for abbreviation.
914 * Tables: Abbrev Tables. Creating and working with abbrev tables.
915 * Defining Abbrevs:: Specifying abbreviations and their expansions.
916 * Files: Abbrev Files. Saving abbrevs in files.
917 * Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines.
918 * Standard Abbrev Tables:: Abbrev tables used by various major modes.
922 * Intro to Extents:: Extents are regions over a buffer or string.
923 * Creating and Modifying Extents::
924 Basic extent functions.
925 * Extent Endpoints:: Accessing and setting the bounds of an extent.
926 * Finding Extents:: Determining which extents are in an object.
927 * Mapping Over Extents:: More sophisticated functions for extent scanning.
928 * Extent Properties:: Extents have built-in and user-definable properties.
929 * Detached Extents:: Extents that are not in a buffer.
930 * Extent Parents:: Inheriting properties from another extent.
931 * Duplicable Extents:: Extents can be marked to be copied into strings.
932 * Extents and Events:: Extents can interact with the keyboard and mouse.
933 * Atomic Extents:: Treating a block of text as a single entity.
937 * Introduction to Specifiers:: Specifiers provide a clean way for
938 display and other properties to vary
939 (under user control) in a wide variety
941 * Specifiers In-Depth:: Gory details about specifier innards.
942 * Specifier Instancing:: Instancing means obtaining the ``value'' of
943 a specifier in a particular context.
944 * Specifier Types:: Specifiers come in different flavors.
945 * Adding Specifications:: Specifications control a specifier's ``value''
946 by giving conditions under which a
947 particular value is valid.
948 * Retrieving Specifications:: Querying a specifier's specifications.
949 * Specifier Instancing Functions::
950 Functions to instance a specifier.
951 * Specifier Examples:: Making all this stuff clearer.
952 * Creating Specifiers:: Creating specifiers for your own use.
953 * Specifier Validation Functions::
954 Validating the components of a specifier.
955 * Other Specification Functions::
956 Other ways of working with specifications.
958 Faces and Window-System Objects
960 * Faces:: Controlling the way text looks.
961 * Fonts:: Controlling the typeface of text.
962 * Colors:: Controlling the color of text and pixmaps.
966 * Merging Faces:: How XEmacs decides which face to use
968 * Basic Face Functions:: How to define and examine faces.
969 * Face Properties:: How to access and modify a face's properties.
970 * Face Convenience Functions:: Convenience functions for accessing
971 particular properties of a face.
972 * Other Face Display Functions:: Other functions pertaining to how a
977 * Font Specifiers:: Specifying how a font will appear.
978 * Font Instances:: What a font specifier gets instanced as.
979 * Font Instance Names:: The name of a font instance.
980 * Font Instance Size:: The size of a font instance.
981 * Font Instance Characteristics:: Display characteristics of font instances.
982 * Font Convenience Functions:: Convenience functions that automatically
983 instance and retrieve the properties
988 * Color Specifiers:: Specifying how a color will appear.
989 * Color Instances:: What a color specifier gets instanced as.
990 * Color Instance Properties:: Properties of color instances.
991 * Color Convenience Functions:: Convenience functions that automatically
992 instance and retrieve the properties
993 of a color specifier.
997 * Glyph Intro:: Glyphs are abstract image specifications.
998 * Images:: Specifying the appearance of glyphs.
999 * Using Glyphs:: Creating and displaying glyphs.
1000 * Manipulating Glyphs:: Getting and setting glyph properties.
1001 * Glyph Examples:: Examples of how to work with glyphs.
1005 * Image Specifiers:: Specifying an image's appearance.
1006 * Image Instantiator Conversion:: Lazy realization of graphics.
1007 * Image Instantiator Formats:: A catalog of image descriptors.
1008 * Image Instances:: Classes of graphical objects.
1012 * Image Instance Types:: Each image instances has a particular type.
1013 * Image Instance Functions:: Functions for working with image instances.
1020 * Image Instance Types:: Each image instances has a particular type.
1021 * Image Instance Functions:: Functions for working with image instances.
1025 * Creating Glyphs:: Creating new glyphs.
1026 * Buffer Glyphs:: Annotations are glyphs that appear in a buffer.
1027 * Redisplay Glyphs:: Glyphs controlling various redisplay functions.
1028 * Frame Glyphs:: Displaying glyphs in GUI components of the frame.
1029 * External Glyphs:: Icons and mouse pointers for the window system.
1030 * Native GUI Widgets:: Complex active elements treated as a single glyph.
1031 * Subwindows:: Externally-controlled subwindows in buffers.
1035 * Introduction to Widgets:: Native widgets provide tight integration of
1036 GUI features with the platform GUI.
1037 * Lisp API to Native Widgets:: Native widgets are glyphs.
1038 * Layouts:: Specifying composite widgets from Lisp.
1039 * Primitive Widgets:: Catalogue of available native widgets.
1043 * Glyph Properties:: Accessing and modifying a glyph's properties.
1044 * Glyph Convenience Functions:: Accessing particular properties of a glyph.
1045 * Glyph Dimensions:: Determining the height, width, etc. of a glyph.
1046 * Glyph Types:: Each glyph has a particular type.
1050 * Annotation Basics:: Introduction to annotations.
1051 * Annotation Primitives:: Creating and deleting annotations.
1052 * Annotation Properties:: Retrieving and changing the characteristics
1054 * Margin Primitives:: Controlling the size of the margins.
1055 * Locating Annotations:: Looking for annotations in a buffer.
1056 * Annotation Hooks:: Hooks called at certain times during an
1057 annotation's lifetime.
1061 * Introduction to Hash Tables:: Hash tables are fast data structures for
1062 implementing simple tables (i.e. finite
1063 mappings from keys to values).
1064 * Working With Hash Tables:: Hash table functions.
1065 * Weak Hash Tables:: Hash tables with special garbage-collection
1070 * Introduction to Range Tables:: Range tables efficiently map ranges of
1072 * Working With Range Tables:: Range table functions.
1077 * Refresh Screen:: Clearing the screen and redrawing everything on it.
1078 * Truncation:: Folding or wrapping long text lines.
1079 * The Echo Area:: Where messages are displayed.
1080 * Selective Display:: Hiding part of the buffer text.
1081 * Overlay Arrow:: Display of an arrow to indicate position.
1082 * Temporary Displays:: Displays that go away automatically.
1083 * Blinking:: How XEmacs shows the matching open parenthesis.
1084 * Usual Display:: The usual conventions for displaying nonprinting chars.
1085 * Display Tables:: How to specify other conventions.
1086 * Beeping:: Audible signal to the user.
1090 * Subprocess Creation:: Functions that start subprocesses.
1091 * Synchronous Processes:: Details of using synchronous subprocesses.
1092 * Asynchronous Processes:: Starting up an asynchronous subprocess.
1093 * Deleting Processes:: Eliminating an asynchronous subprocess.
1094 * Process Information:: Accessing run-status and other attributes.
1095 * Input to Processes:: Sending input to an asynchronous subprocess.
1096 * Signals to Processes:: Stopping, continuing or interrupting
1097 an asynchronous subprocess.
1098 * Output from Processes:: Collecting output from an asynchronous subprocess.
1099 * Sentinels:: Sentinels run when process run-status changes.
1100 * Network:: Opening network connections.
1102 Receiving Output from Processes
1104 * Process Buffers:: If no filter, output is put in a buffer.
1105 * Filter Functions:: Filter functions accept output from the process.
1106 * Accepting Output:: How to wait until process output arrives.
1108 Operating System Interface
1110 * Starting Up:: Customizing XEmacs start-up processing.
1111 * Getting Out:: How exiting works (permanent or temporary).
1112 * System Environment:: Distinguish the name and kind of system.
1113 * Terminal Input:: Recording terminal input for debugging.
1114 * Terminal Output:: Recording terminal output for debugging.
1115 * Flow Control:: How to turn output flow control on or off.
1116 * Batch Mode:: Running XEmacs without terminal interaction.
1120 * Start-up Summary:: Sequence of actions XEmacs performs at start-up.
1121 * Init File:: Details on reading the init file (@file{.emacs}).
1122 * Terminal-Specific:: How the terminal-specific Lisp file is read.
1123 * Command Line Arguments:: How command line arguments are processed,
1124 and how you can customize them.
1126 Getting out of XEmacs
1128 * Killing XEmacs:: Exiting XEmacs irreversibly.
1129 * Suspending XEmacs:: Exiting XEmacs reversibly.
1133 * X Selections:: Transferring text to and from other X clients.
1134 * X Server:: Information about the X server connected to
1135 a particular device.
1136 * Resources:: Getting resource values from the server.
1137 * Server Data:: Getting info about the X server.
1138 * Grabs:: Restricting access to the server by other apps.
1139 * X Miscellaneous:: Other X-specific functions and variables.
1143 * XEmacs ToolTalk API Summary::
1144 * Sending Messages::
1145 * Receiving Messages::
1149 * Building XEmacs with LDAP support:: How to add LDAP support to XEmacs
1150 * XEmacs LDAP API:: Lisp access to LDAP functions
1151 * Syntax of Search Filters:: A brief summary of RFC 1558
1155 * LDAP Variables:: Lisp variables related to LDAP
1156 * The High-Level LDAP API:: High-level LDAP lisp functions
1157 * The Low-Level LDAP API:: Low-level LDAP lisp primitives
1158 * LDAP Internationalization:: I18n variables and functions
1160 The Low-Level LDAP API
1162 * The LDAP Lisp Object::
1163 * Opening and Closing a LDAP Connection::
1164 * Low-level Operations on a LDAP Server::
1166 LDAP Internationalization
1168 * LDAP Internationalization Variables::
1169 * Encoder/Decoder Functions::
1171 Internationalization
1173 * I18N Levels 1 and 2:: Support for different time, date, and currency formats.
1174 * I18N Level 3:: Support for localized messages.
1175 * I18N Level 4:: Support for Asian languages.
1179 * Internationalization Terminology::
1180 Definition of various internationalization terms.
1181 * Charsets:: Sets of related characters.
1182 * MULE Characters:: Working with characters in XEmacs/MULE.
1183 * Composite Characters:: Making new characters by overstriking other ones.
1184 * ISO 2022:: An international standard for charsets and encodings.
1185 * Coding Systems:: Ways of representing a string of chars using integers.
1186 * CCL:: A special language for writing fast converters.
1187 * Category Tables:: Subdividing charsets into groups.
1191 * Style Tips:: Writing clean and robust programs.
1192 * Compilation Tips:: Making compiled code run fast.
1193 * Documentation Tips:: Writing readable documentation strings.
1194 * Comment Tips:: Conventions for writing comments.
1195 * Library Headers:: Standard headers for library packages.
1197 Building XEmacs and Object Allocation
1199 * Building XEmacs:: How to preload Lisp libraries into XEmacs.
1200 * Pure Storage:: A kludge to make preloaded Lisp functions sharable.
1201 * Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1206 @include packaging.texi
1207 @include objects.texi
1208 @include numbers.texi
1209 @include strings.texi
1212 @include sequences.texi
1213 @include symbols.texi
1216 @include control.texi
1217 @include variables.texi
1218 @include functions.texi
1219 @include macros.texi
1220 @include customize.texi
1222 @include loading.texi
1223 @include compile.texi
1224 @include debugging.texi
1225 @include streams.texi
1227 @include minibuf.texi
1228 @include commands.texi
1229 @include keymaps.texi
1231 @include dialog.texi
1232 @include toolbar.texi
1233 @include gutter.texi
1234 @include scrollbars.texi
1235 @include dragndrop.texi
1240 @include backups.texi
1241 @include buffers.texi
1243 @include windows.texi
1244 @include frames.texi
1245 @include consoles-devices.texi
1246 @include positions.texi
1247 @include markers.texi
1250 @include searching.texi
1251 @include syntax.texi
1252 @include abbrevs.texi
1254 @include extents.texi
1255 @include specifiers.texi
1257 @include glyphs.texi
1258 @include annotations.texi
1259 @include display.texi
1261 @include hash-tables.texi
1262 @include range-tables.texi
1263 @include databases.texi
1265 @include processes.texi
1267 @include x-windows.texi
1268 @include tooltalk.texi
1270 @include postgresql.texi
1271 @include internationalization.texi
1274 @c MOVE to User's Manual: include calendar.texi
1276 @c MOVE to User's Manual: include misc-modes.texi
1280 @c REMOVE this: include non-hacker.texi
1283 @include building.texi
1284 @include errors.texi
1285 @include locals.texi
1291 @c Print the tables of contents
1299 These words prevent "local variables" above from confusing XEmacs.