comparison man/internals/internals.texi @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children d620409f5eb8
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
144 Rules When Writing New C Code 144 Rules When Writing New C Code
145 145
146 * General Coding Rules:: 146 * General Coding Rules::
147 * Writing Lisp Primitives:: 147 * Writing Lisp Primitives::
148 * Adding Global Lisp Variables:: 148 * Adding Global Lisp Variables::
149 * Techniques for XEmacs Developers::
149 150
150 A Summary of the Various XEmacs Modules 151 A Summary of the Various XEmacs Modules
151 152
152 * Low-Level Modules:: 153 * Low-Level Modules::
153 * Basic Lisp Modules:: 154 * Basic Lisp Modules::
367 @item 368 @item
368 version 18.35 (a beta version) released on January 5, 1987. 369 version 18.35 (a beta version) released on January 5, 1987.
369 @item 370 @item
370 version 18.36 (a beta version) released on January 21, 1987. 371 version 18.36 (a beta version) released on January 21, 1987.
371 @item 372 @item
373 January 27, 1987: The Great Usenet Renaming. net.emacs is now
374 comp.emacs.
375 @item
372 version 18.37 (a beta version) released on February 12, 1987. 376 version 18.37 (a beta version) released on February 12, 1987.
373 @item 377 @item
374 version 18.38 (a beta version) released on March 3, 1987. 378 version 18.38 (a beta version) released on March 3, 1987.
375 @item 379 @item
376 version 18.39 (a beta version) released on March 14, 1987. 380 version 18.39 (a beta version) released on March 14, 1987.
393 version 18.50 released on February 13, 1988. 397 version 18.50 released on February 13, 1988.
394 @item 398 @item
395 version 18.51 released on May 7, 1988. 399 version 18.51 released on May 7, 1988.
396 @item 400 @item
397 version 18.52 released on September 1, 1988. 401 version 18.52 released on September 1, 1988.
398 @item
399 January 27, 1989: The Great Usenet Renaming. net.emacs is now
400 comp.emacs.
401 @item 402 @item
402 version 18.53 released on February 24, 1989. 403 version 18.53 released on February 24, 1989.
403 @item 404 @item
404 version 18.54 released on April 26, 1989. 405 version 18.54 released on April 26, 1989.
405 @item 406 @item
1000 @end itemize 1001 @end itemize
1001 1002
1002 etc. 1003 etc.
1003 1004
1004 The important idea here is that there are a number of independent 1005 The important idea here is that there are a number of independent
1005 subsystems each with their own responsibility and persistent state, just 1006 subsystems each with its own responsibility and persistent state, just
1006 like different employees in a company, and each subsystem is 1007 like different employees in a company, and each subsystem is
1007 periodically given commands from other subsystems. Commands can flow 1008 periodically given commands from other subsystems. Commands can flow
1008 from any one subsystem to any other, but there is usually some sort of 1009 from any one subsystem to any other, but there is usually some sort of
1009 hierarchy, with all commands originating from the event subsystem. 1010 hierarchy, with all commands originating from the event subsystem.
1010 1011
1572 1573
1573 @menu 1574 @menu
1574 * General Coding Rules:: 1575 * General Coding Rules::
1575 * Writing Lisp Primitives:: 1576 * Writing Lisp Primitives::
1576 * Adding Global Lisp Variables:: 1577 * Adding Global Lisp Variables::
1578 * Techniques for XEmacs Developers::
1577 @end menu 1579 @end menu
1578 1580
1579 @node General Coding Rules 1581 @node General Coding Rules
1580 @section General Coding Rules 1582 @section General Coding Rules
1581 1583
1944 garbage-collection mechanism won't know that the object in this variable 1946 garbage-collection mechanism won't know that the object in this variable
1945 is in use, and will happily collect it and reuse its storage for another 1947 is in use, and will happily collect it and reuse its storage for another
1946 Lisp object, and you will be the one who's unhappy when you can't figure 1948 Lisp object, and you will be the one who's unhappy when you can't figure
1947 out how your variable got overwritten. 1949 out how your variable got overwritten.
1948 1950
1951 @node Techniques for XEmacs Developers
1952 @section Techniques for XEmacs Developers
1953
1954 To make a quantified XEmacs, do: @code{make quantmacs}.
1955
1956 You simply can't dump Quantified and Purified images. Run the image
1957 like so: @code{quantmacs -batch -l loadup.el run-temacs -q}.
1958
1959 Before you go through the trouble, are you compiling with all
1960 debugging and error-checking off? If not try that first. Be warned
1961 that while Quantify is directly responsible for quite a few
1962 optimizations which have been made to XEmacs, doing a run which
1963 generates results which can be acted upon is not necessarily a trivial
1964 task.
1965
1966 Also, if you're still willing to do some runs make sure you configure
1967 with the @samp{--quantify} flag. That will keep Quantify from starting
1968 to record data until after the loadup is completed and will shut off
1969 recording right before it shuts down (which generates enough bogus data
1970 to throw most results off). It also enables three additional elisp
1971 commands: @code{quantify-start-recording-data},
1972 @code{quantify-stop-recording-data} and @code{quantify-clear-data}.
1973
1974 To get started debugging XEmacs, take a look at the @file{gdbinit} and
1975 @file{dbxrc} files in the @file{src} directory.
1976
1977
1949 @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top 1978 @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top
1950 @chapter A Summary of the Various XEmacs Modules 1979 @chapter A Summary of the Various XEmacs Modules
1951 1980
1952 This is accurate as of XEmacs 20.0. 1981 This is accurate as of XEmacs 20.0.
1953 1982
2233 in their C structure, which includes all objects except the few most 2262 in their C structure, which includes all objects except the few most
2234 basic ones. 2263 basic ones.
2235 2264
2236 @file{emacsfns.h} contains prototypes for most of the exported functions 2265 @file{emacsfns.h} contains prototypes for most of the exported functions
2237 in the various modules. (In particular, prototypes for Lisp primitives 2266 in the various modules. (In particular, prototypes for Lisp primitives
2238 should always go in this header file. Prototypes for other functions 2267 should always go into this header file. Prototypes for other functions
2239 can either go here or in a module-specific header file, depending on how 2268 can either go here or in a module-specific header file, depending on how
2240 general-purpose the function is and whether it has special-purpose 2269 general-purpose the function is and whether it has special-purpose
2241 argument types requiring definitions not in @file{lisp.h}.) All 2270 argument types requiring definitions not in @file{lisp.h}.) All
2242 initialization functions are prototyped in @file{symsinit.h}. 2271 initialization functions are prototyped in @file{symsinit.h}.
2243 2272
2407 82900 buffer.c 2436 82900 buffer.c
2408 60964 buffer.h 2437 60964 buffer.h
2409 6059 bufslots.h 2438 6059 bufslots.h
2410 @end example 2439 @end example
2411 2440
2412 @file{buffer.c} implements the buffer Lisp object type. This includes 2441 @file{buffer.c} implements the @dfn{buffer} Lisp object type. This
2413 functions that create and destroy buffers; retrieve buffers by name or 2442 includes functions that create and destroy buffers; retrieve buffers by
2414 by other properties; manipulate lists of buffers (remember that buffers 2443 name or by other properties; manipulate lists of buffers (remember that
2415 are permanent objects and stored in various ordered lists); retrieve or 2444 buffers are permanent objects and stored in various ordered lists);
2416 change buffer properties; etc. It also contains the definitions of all 2445 retrieve or change buffer properties; etc. It also contains the
2417 the built-in buffer-local variables (which can be viewed as buffer 2446 definitions of all the built-in buffer-local variables (which can be
2418 properties). It does @emph{not} contain code to manipulate buffer-local 2447 viewed as buffer properties). It does @emph{not} contain code to
2419 variables (that's in @file{symbols.c}, described above); or code to manipulate 2448 manipulate buffer-local variables (that's in @file{symbols.c}, described
2420 the text in a buffer. 2449 above); or code to manipulate the text in a buffer.
2421 2450
2422 @file{buffer.h} defines the structures associated with a buffer and the various 2451 @file{buffer.h} defines the structures associated with a buffer and the various
2423 macros for retrieving text from a buffer and special buffer positions 2452 macros for retrieving text from a buffer and special buffer positions
2424 (e.g. @code{point}, the default location for text insertion). It also 2453 (e.g. @code{point}, the default location for text insertion). It also
2425 contains macros for working with buffer positions and converting between 2454 contains macros for working with buffer positions and converting between
2451 2480
2452 @example 2481 @example
2453 10975 marker.c 2482 10975 marker.c
2454 @end example 2483 @end example
2455 2484
2456 This module implements the marker Lisp object type, which conceptually 2485 This module implements the @dfn{marker} Lisp object type, which
2457 is a pointer to a text position in a buffer that moves around as text is 2486 conceptually is a pointer to a text position in a buffer that moves
2458 inserted and deleted, so as to remain in the same relative position. 2487 around as text is inserted and deleted, so as to remain in the same
2459 This module doesn't actually move the markers around -- that's handled 2488 relative position. This module doesn't actually move the markers around
2460 in @file{insdel.c}. This module just creates them and implements the 2489 -- that's handled in @file{insdel.c}. This module just creates them and
2461 primitives for working with them. As markers are simple objects, this 2490 implements the primitives for working with them. As markers are simple
2462 does not entail much. 2491 objects, this does not entail much.
2463 2492
2464 Note that the standard arithmetic primitives (e.g. @code{+}) accept 2493 Note that the standard arithmetic primitives (e.g. @code{+}) accept
2465 markers in place of integers and automatically substitute the value of 2494 markers in place of integers and automatically substitute the value of
2466 @code{marker-position} for the marker, i.e. an integer describing the 2495 @code{marker-position} for the marker, i.e. an integer describing the
2467 current buffer position of the marker. 2496 current buffer position of the marker.
2471 @example 2500 @example
2472 193714 extents.c 2501 193714 extents.c
2473 15686 extents.h 2502 15686 extents.h
2474 @end example 2503 @end example
2475 2504
2476 This module implements the extent Lisp object type, which is like a 2505 This module implements the @dfn{extent} Lisp object type, which is like
2477 marker that works over a range of text rather than a single position. 2506 a marker that works over a range of text rather than a single position.
2478 Extents are also much more complex and powerful than markers and have a 2507 Extents are also much more complex and powerful than markers and have a
2479 more efficient (and more algorithmically complex) implementation. The 2508 more efficient (and more algorithmically complex) implementation. The
2480 implementation is described in detail in comments in @file{extents.c}. 2509 implementation is described in detail in comments in @file{extents.c}.
2481 2510
2482 The code in @file{extents.c} works closely with @file{insdel.c} so that 2511 The code in @file{extents.c} works closely with @file{insdel.c} so that
2584 @end example 2613 @end example
2585 2614
2586 These implement the handling of events (user input and other system 2615 These implement the handling of events (user input and other system
2587 notifications). 2616 notifications).
2588 2617
2589 @file{events.c} and @file{events.h} define the event Lisp object type 2618 @file{events.c} and @file{events.h} define the @dfn{event} Lisp object
2590 and primitives for manipulating it. 2619 type and primitives for manipulating it.
2591 2620
2592 @file{event-stream.c} implements the basic functions for working with 2621 @file{event-stream.c} implements the basic functions for working with
2593 event queues, dispatching an event by looking it up in relevant keymaps 2622 event queues, dispatching an event by looking it up in relevant keymaps
2594 and such, and handling timeouts; this includes the primitives 2623 and such, and handling timeouts; this includes the primitives
2595 @code{next-event} and @code{dispatch-event}, as well as related 2624 @code{next-event} and @code{dispatch-event}, as well as related
2622 @example 2651 @example
2623 129583 keymap.c 2652 129583 keymap.c
2624 2621 keymap.h 2653 2621 keymap.h
2625 @end example 2654 @end example
2626 2655
2627 @file{keymap.c} and @file{keymap.h} define the keymap Lisp object type 2656 @file{keymap.c} and @file{keymap.h} define the @dfn{keymap} Lisp object
2628 and associated methods and primitives. (Remember that keymaps are 2657 type and associated methods and primitives. (Remember that keymaps are
2629 objects that associate event descriptions with functions to be called to 2658 objects that associate event descriptions with functions to be called to
2630 ``execute'' those events; @code{dispatch-event} looks up events in the 2659 ``execute'' those events; @code{dispatch-event} looks up events in the
2631 relevant keymaps.) 2660 relevant keymaps.)
2632 2661
2633 2662
2685 11667 device-x.h 2714 11667 device-x.h
2686 26056 device.c 2715 26056 device.c
2687 22993 device.h 2716 22993 device.h
2688 @end example 2717 @end example
2689 2718
2690 These modules implement the device Lisp object type. This abstracts a 2719 These modules implement the @dfn{device} Lisp object type. This
2691 particular screen or connection on which frames are displayed. As with 2720 abstracts a particular screen or connection on which frames are
2692 Lisp objects, event interfaces, and other subsystems, the device code is 2721 displayed. As with Lisp objects, event interfaces, and other
2693 separated into a generic component that contains a standardized 2722 subsystems, the device code is separated into a generic component that
2694 interface (in the form of a set of methods) onto particular device 2723 contains a standardized interface (in the form of a set of methods) onto
2695 types. 2724 particular device types.
2696 2725
2697 The device subsystem defines all the methods and provides method 2726 The device subsystem defines all the methods and provides method
2698 services for not only device operations but also for the frame, window, 2727 services for not only device operations but also for the frame, window,
2699 menubar, scrollbar, toolbar, and other displayable-object subsystems. 2728 menubar, scrollbar, toolbar, and other displayable-object subsystems.
2700 The reason for this is that all of these subsystems have the same 2729 The reason for this is that all of these subsystems have the same
2716 usually this is a top-level window but it could potentially be one of a 2745 usually this is a top-level window but it could potentially be one of a
2717 number of overlapping child windows within a top-level window, using the 2746 number of overlapping child windows within a top-level window, using the
2718 MDI (Multiple Document Interface) protocol in Microsoft Windows or a 2747 MDI (Multiple Document Interface) protocol in Microsoft Windows or a
2719 similar scheme. 2748 similar scheme.
2720 2749
2721 The @file{frame-*} files implement the frame Lisp object type and provide the 2750 The @file{frame-*} files implement the @dfn{frame} Lisp object type and
2722 generic and device-type-specific operations on frames (e.g. raising, 2751 provide the generic and device-type-specific operations on frames
2723 lowering, resizing, moving, etc.). 2752 (e.g. raising, lowering, resizing, moving, etc.).
2724 2753
2725 2754
2726 2755
2727 @example 2756 @example
2728 160783 window.c 2757 160783 window.c
2734 Each frame consists of one or more non-overlapping @dfn{windows} (better 2763 Each frame consists of one or more non-overlapping @dfn{windows} (better
2735 known as @dfn{panes} in standard window-system terminology) in which a 2764 known as @dfn{panes} in standard window-system terminology) in which a
2736 buffer's text can be displayed. Windows can also have scrollbars 2765 buffer's text can be displayed. Windows can also have scrollbars
2737 displayed around their edges. 2766 displayed around their edges.
2738 2767
2739 @file{window.c} and @file{window.h} implement the window Lisp object 2768 @file{window.c} and @file{window.h} implement the @dfn{window} Lisp
2740 type and provide code to manage windows. Since windows have no 2769 object type and provide code to manage windows. Since windows have no
2741 associated resources in the window system (the window system knows only 2770 associated resources in the window system (the window system knows only
2742 about the frame; no child windows or anything are used for XEmacs 2771 about the frame; no child windows or anything are used for XEmacs
2743 windows), there is no device-type-specific code here; all of that code 2772 windows), there is no device-type-specific code here; all of that code
2744 is part of the redisplay mechanism or the code for particular object 2773 is part of the redisplay mechanism or the code for particular object
2745 types such as scrollbars. 2774 types such as scrollbars.
2909 ------- --------------------- 2938 ------- ---------------------
2910 43362 lstream.c 2939 43362 lstream.c
2911 14240 lstream.h 2940 14240 lstream.h
2912 @end example 2941 @end example
2913 2942
2914 These modules implement the stream Lisp object type. This is an 2943 These modules implement the @dfn{stream} Lisp object type. This is an
2915 internal-only Lisp object that implements a generic buffering stream. 2944 internal-only Lisp object that implements a generic buffering stream.
2916 The idea is to provide a uniform interface onto all sources and sinks of 2945 The idea is to provide a uniform interface onto all sources and sinks of
2917 data, including file descriptors, stdio streams, chunks of memory, Lisp 2946 data, including file descriptors, stdio streams, chunks of memory, Lisp
2918 buffers, Lisp strings, etc. That way, I/O functions can be written to 2947 buffers, Lisp strings, etc. That way, I/O functions can be written to
2919 the stream interface and can transparently handle all possible sources 2948 the stream interface and can transparently handle all possible sources
3014 2454 elhash.h 3043 2454 elhash.h
3015 12169 hash.c 3044 12169 hash.c
3016 3369 hash.h 3045 3369 hash.h
3017 @end example 3046 @end example
3018 3047
3019 These files implement the hashtable Lisp object type. @file{hash.c} and 3048 These files implement the @dfn{hashtable} Lisp object type.
3020 @file{hash.h} provide a generic C implementation of hash tables (which 3049 @file{hash.c} and @file{hash.h} provide a generic C implementation of
3021 can stand independently of XEmacs), and @file{elhash.c} and 3050 hash tables (which can stand independently of XEmacs), and
3022 @file{elhash.h} provide a Lisp interface onto the C hash tables using 3051 @file{elhash.c} and @file{elhash.h} provide a Lisp interface onto the C
3023 the hashtable Lisp object type. 3052 hash tables using the hashtable Lisp object type.
3024 3053
3025 3054
3026 3055
3027 @example 3056 @example
3028 95691 specifier.c 3057 95691 specifier.c
3029 11167 specifier.h 3058 11167 specifier.h
3030 @end example 3059 @end example
3031 3060
3032 This module implements the specifier Lisp object type. This is 3061 This module implements the @dfn{specifier} Lisp object type. This is
3033 primarily used for displayable properties, and allows for values that 3062 primarily used for displayable properties, and allows for values that
3034 are specific to a particular buffer, window, frame, device, or device 3063 are specific to a particular buffer, window, frame, device, or device
3035 class, as well as a default value existing. This is used, for example, 3064 class, as well as a default value existing. This is used, for example,
3036 to control the height of the horizontal scrollbar or the appearance of 3065 to control the height of the horizontal scrollbar or the appearance of
3037 the @code{default}, @code{bold}, or other faces. The specifier object 3066 the @code{default}, @code{bold}, or other faces. The specifier object
3092 3121
3093 @example 3122 @example
3094 20234 rangetab.c 3123 20234 rangetab.c
3095 @end example 3124 @end example
3096 3125
3097 This module implements the range table Lisp object type, which provides 3126 This module implements the @dfn{range table} Lisp object type, which
3098 for a mapping from ranges of integers to arbitrary Lisp objects. 3127 provides for a mapping from ranges of integers to arbitrary Lisp
3128 objects.
3099 3129
3100 3130
3101 3131
3102 @example 3132 @example
3103 3201 opaque.c 3133 3201 opaque.c
3104 2206 opaque.h 3134 2206 opaque.h
3105 @end example 3135 @end example
3106 3136
3107 This module implements the opaque Lisp object type, an internal-only 3137 This module implements the @dfn{opaque} Lisp object type, an
3108 Lisp object that encapsulates an arbitrary block of memory so that it 3138 internal-only Lisp object that encapsulates an arbitrary block of memory
3109 can be managed by the Lisp allocation system. To create an opaque 3139 so that it can be managed by the Lisp allocation system. To create an
3110 object, you call @code{make_opaque()}, passing a pointer to a block of 3140 opaque object, you call @code{make_opaque()}, passing a pointer to a
3111 memory. An object is created that is big enough to hold the memory, 3141 block of memory. An object is created that is big enough to hold the
3112 which is copied into the object's storage. The object will then stick 3142 memory, which is copied into the object's storage. The object will then
3113 around as long as you keep pointers to it, after which it will be 3143 stick around as long as you keep pointers to it, after which it will be
3114 automatically reclaimed. 3144 automatically reclaimed.
3115 3145
3116 @cindex mark method 3146 @cindex mark method
3117 Opaque objects can also have an arbitrary @dfn{mark method} associated 3147 Opaque objects can also have an arbitrary @dfn{mark method} associated
3118 with them, in case the block of memory contains other Lisp objects that 3148 with them, in case the block of memory contains other Lisp objects that
3627 actually provides a general interface for all sorts of languages, not 3657 actually provides a general interface for all sorts of languages, not
3628 just Asian languages (although they are generally the most complicated 3658 just Asian languages (although they are generally the most complicated
3629 to support). This code is still in beta. 3659 to support). This code is still in beta.
3630 3660
3631 @file{mule-charset.*} and @file{mule-coding.*} provide the heart of the 3661 @file{mule-charset.*} and @file{mule-coding.*} provide the heart of the
3632 XEmacs MULE support. @file{mule-charset.*} implements the @dfn{charset} Lisp object, 3662 XEmacs MULE support. @file{mule-charset.*} implements the @dfn{charset}
3633 which encapsulates a character set (an ordered one- or two-dimensional 3663 Lisp object type, which encapsulates a character set (an ordered one- or
3634 set of characters, such as US ASCII or JISX0208 Japanese Kanji). 3664 two-dimensional set of characters, such as US ASCII or JISX0208 Japanese
3635 @file{mule-coding.*} implements the coding-system Lisp object, which 3665 Kanji).
3636 encapsulates a method of converting between different encodings. An 3666
3637 encoding is a representation of a stream of characters from multiple 3667 @file{mule-coding.*} implements the @dfn{coding-system} Lisp object
3638 character sets using a stream of bytes or words and defines (e.g.) which 3668 type, which encapsulates a method of converting between different
3639 escape sequences are used to specify particular character sets, how the 3669 encodings. An encoding is a representation of a stream of characters
3640 indices for a character are converted into bytes (sometimes this 3670 from multiple character sets using a stream of bytes or words and
3641 involves setting the high bit; sometimes complicated rearranging of the 3671 defines (e.g.) which escape sequences are used to specify particular
3642 values takes place, as in the Shift-JIS encoding), etc. 3672 character sets, how the indices for a character are converted into bytes
3673 (sometimes this involves setting the high bit; sometimes complicated
3674 rearranging of the values takes place, as in the Shift-JIS encoding),
3675 etc.
3643 3676
3644 @file{mule-ccl.c} provides the CCL (Code Conversion Language) 3677 @file{mule-ccl.c} provides the CCL (Code Conversion Language)
3645 interpreter. CCL is similar in spirit to Lisp byte code and is used to 3678 interpreter. CCL is similar in spirit to Lisp byte code and is used to
3646 implement converters for custom encodings. 3679 implement converters for custom encodings.
3647 3680
4089 4122
4090 Simple lrecords (of type (c) above) just have a @code{struct 4123 Simple lrecords (of type (c) above) just have a @code{struct
4091 lrecord_header} at their beginning. lcrecords, however, actually have a 4124 lrecord_header} at their beginning. lcrecords, however, actually have a
4092 @code{struct lcrecord_header}. This, in turn, has a @code{struct 4125 @code{struct lcrecord_header}. This, in turn, has a @code{struct
4093 lrecord_header} at its beginning, so sanity is preserved; but it also 4126 lrecord_header} at its beginning, so sanity is preserved; but it also
4094 has a pointer used to chain all lrecords together, and a special ID 4127 has a pointer used to chain all lcrecords together, and a special ID
4095 field used to distinguish one lcrecord from another. (This field is used 4128 field used to distinguish one lcrecord from another. (This field is used
4096 only for debugging and could be removed, but the space gain is not 4129 only for debugging and could be removed, but the space gain is not
4097 significant.) 4130 significant.)
4098 4131
4099 Simple lrecords are created using @code{ALLOCATE_FIXED_TYPE()}, just 4132 Simple lrecords are created using @code{ALLOCATE_FIXED_TYPE()}, just
4460 During the sweep stage of garbage collection, when objects are 4493 During the sweep stage of garbage collection, when objects are
4461 reclaimed, the garbage collector goes through all string-chars blocks, 4494 reclaimed, the garbage collector goes through all string-chars blocks,
4462 looking for unused strings. Each chunk of string data is preceded by a 4495 looking for unused strings. Each chunk of string data is preceded by a
4463 pointer to the corresponding @code{struct Lisp_String}, which indicates 4496 pointer to the corresponding @code{struct Lisp_String}, which indicates
4464 both whether the string is used and how big the string is, i.e. how to 4497 both whether the string is used and how big the string is, i.e. how to
4465 get to the next chuck of string data. Holes are compressed by 4498 get to the next chunk of string data. Holes are compressed by
4466 block-copying the next string into the empty space and relocating the 4499 block-copying the next string into the empty space and relocating the
4467 pointer stored in the corresponding @code{struct Lisp_String}. 4500 pointer stored in the corresponding @code{struct Lisp_String}.
4468 @strong{This means you have to be careful with strings in your code.} 4501 @strong{This means you have to be careful with strings in your code.}
4469 See the section above on @code{GCPRO}ing. 4502 See the section above on @code{GCPRO}ing.
4470 4503
4532 Events come into the system in an asynchronous fashion (typically 4565 Events come into the system in an asynchronous fashion (typically
4533 through a callback being called) and are converted into a 4566 through a callback being called) and are converted into a
4534 synchronous event queue (first-in, first-out) in a process that 4567 synchronous event queue (first-in, first-out) in a process that
4535 we will call @dfn{collection}. 4568 we will call @dfn{collection}.
4536 4569
4537 Note that each application has their own event queue. (It is 4570 Note that each application has its own event queue. (It is
4538 immaterial whether the collection process directly puts the 4571 immaterial whether the collection process directly puts the
4539 events in the proper application's queue, or puts them into 4572 events in the proper application's queue, or puts them into
4540 a single system queue, which is later split up.) 4573 a single system queue, which is later split up.)
4541 4574
4542 The most basic level of event collection is done by the 4575 The most basic level of event collection is done by the
5003 5036
5004 @example 5037 @example
5005 struct specbinding 5038 struct specbinding
5006 @{ 5039 @{
5007 Lisp_Object symbol, old_value; 5040 Lisp_Object symbol, old_value;
5008 Lisp_Object (*func) (); 5041 Lisp_Object (*func) (Lisp_Object); /* for unwind-protect */
5009 Lisp_Object unused; /* Dividing by 16 is faster than by 12 */
5010 @}; 5042 @};
5011 @end example 5043 @end example
5012 5044
5013 @code{struct specbinding} is used for local-variable bindings and 5045 @code{struct specbinding} is used for local-variable bindings and
5014 unwind-protects. @code{specpdl} holds an array of @code{struct specbinding}'s, 5046 unwind-protects. @code{specpdl} holds an array of @code{struct specbinding}'s,
6396 already-running XEmacs process to display another frame on your local 6428 already-running XEmacs process to display another frame on your local
6397 TTY. 6429 TTY.
6398 6430
6399 Thus, there is a hierarchy console -> display -> frame -> window. 6431 Thus, there is a hierarchy console -> display -> frame -> window.
6400 There is a separate Lisp object type for each of these four concepts. 6432 There is a separate Lisp object type for each of these four concepts.
6401 Furthermore, there is logically a @dfn{selected console}, 6433 Furthermore, there is logically a @dfn{selected console},
6402 @dfn{selected display}, @dfn{selected frame}, and @dfn{selected window}. 6434 @dfn{selected display}, @dfn{selected frame}, and @dfn{selected window}.
6403 This particular object is distinguished in various ways, such as 6435 Each of these objects is distinguished in various ways, such as being the
6404 that it is the default object for various functions that act 6436 default object for various functions that act on objects of that type.
6405 on objects of that type. Note that every containing object 6437 Note that every containing object rememembers the ``selected'' object
6406 rememembers the ``selected'' object among the objects that it 6438 among the objects that it contains: e.g. not only is there a selected
6407 contains: e.g. not only is there a selected window, but 6439 window, but every frame remembers the last window in it that was
6408 every frame remembers the last window in it that was selected, 6440 selected, and changing the selected frame causes the remembered window
6409 and changing the selected frame causes the remembered window 6441 within it to become the selected window. Similar relationships apply
6410 within it to become the selected window. Similar relationships 6442 for consoles to devices and devices to frames.
6411 apply for consoles to devices and devices to frames.
6412 6443
6413 @node Point 6444 @node Point
6414 @section Point 6445 @section Point
6415 6446
6416 Recall that every buffer has a current insertion position, called 6447 Recall that every buffer has a current insertion position, called
6463 6494
6464 Here are some rules: 6495 Here are some rules:
6465 6496
6466 @enumerate 6497 @enumerate
6467 @item 6498 @item
6468 Horizontal combination windows can never have children that 6499 Horizontal combination windows can never have children that are
6469 are horizontal combination windows; same for vertical. 6500 horizontal combination windows; same for vertical.
6470 6501
6471 @item 6502 @item
6472 Only leaf windows can be split (obviously) and this splitting does one 6503 Only leaf windows can be split (obviously) and this splitting does one
6473 of two things: (a) turns the leaf window into a combination window and 6504 of two things: (a) turns the leaf window into a combination window and
6474 creates two new leaf children, or (b) turns the leaf window into one of 6505 creates two new leaf children, or (b) turns the leaf window into one of