XEmacs 21.4.15
[chise/xemacs-chise.git.1] / info / internals.info-2
1 This is ../info/internals.info, produced by makeinfo version 4.6 from
2 internals/internals.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * Internals: (internals).       XEmacs Internals Manual.
7 END-INFO-DIR-ENTRY
8
9    Copyright (C) 1992 - 1996 Ben Wing.  Copyright (C) 1996, 1997 Sun
10 Microsystems.  Copyright (C) 1994 - 1998, 2002, 2003 Free Software
11 Foundation.  Copyright (C) 1994, 1995 Board of Trustees, University of
12 Illinois.
13
14    Permission is granted to make and distribute verbatim copies of this
15 manual provided the copyright notice and this permission notice are
16 preserved on all copies.
17
18    Permission is granted to copy and distribute modified versions of
19 this manual under the conditions for verbatim copying, provided that the
20 entire resulting derived work is distributed under the terms of a
21 permission notice identical to this one.
22
23    Permission is granted to copy and distribute translations of this
24 manual into another language, under the above conditions for modified
25 versions, except that this permission notice may be stated in a
26 translation approved by the Foundation.
27
28    Permission is granted to copy and distribute modified versions of
29 this manual under the conditions for verbatim copying, provided also
30 that the section entitled "GNU General Public License" is included
31 exactly as in the original, and provided that the entire resulting
32 derived work is distributed under the terms of a permission notice
33 identical to this one.
34
35    Permission is granted to copy and distribute translations of this
36 manual into another language, under the above conditions for modified
37 versions, except that the section entitled "GNU General Public License"
38 may be included in a translation approved by the Free Software
39 Foundation instead of in the original English.
40
41 \1f
42 File: internals.info,  Node: Introduction to Symbols,  Next: Obarrays,  Up: Symbols and Variables
43
44 Introduction to Symbols
45 =======================
46
47 A symbol is basically just an object with four fields: a name (a
48 string), a value (some Lisp object), a function (some Lisp object), and
49 a property list (usually a list of alternating keyword/value pairs).
50 What makes symbols special is that there is usually only one symbol with
51 a given name, and the symbol is referred to by name.  This makes a
52 symbol a convenient way of calling up data by name, i.e. of implementing
53 variables. (The variable's value is stored in the "value slot".)
54 Similarly, functions are referenced by name, and the definition of the
55 function is stored in a symbol's "function slot".  This means that
56 there can be a distinct function and variable with the same name.  The
57 property list is used as a more general mechanism of associating
58 additional values with particular names, and once again the namespace is
59 independent of the function and variable namespaces.
60
61 \1f
62 File: internals.info,  Node: Obarrays,  Next: Symbol Values,  Prev: Introduction to Symbols,  Up: Symbols and Variables
63
64 Obarrays
65 ========
66
67 The identity of symbols with their names is accomplished through a
68 structure called an obarray, which is just a poorly-implemented hash
69 table mapping from strings to symbols whose name is that string. (I say
70 "poorly implemented" because an obarray appears in Lisp as a vector
71 with some hidden fields rather than as its own opaque type.  This is an
72 Emacs Lisp artifact that should be fixed.)
73
74    Obarrays are implemented as a vector of some fixed size (which should
75 be a prime for best results), where each "bucket" of the vector
76 contains one or more symbols, threaded through a hidden `next' field in
77 the symbol.  Lookup of a symbol in an obarray, and adding a symbol to
78 an obarray, is accomplished through standard hash-table techniques.
79
80    The standard Lisp function for working with symbols and obarrays is
81 `intern'.  This looks up a symbol in an obarray given its name; if it's
82 not found, a new symbol is automatically created with the specified
83 name, added to the obarray, and returned.  This is what happens when the
84 Lisp reader encounters a symbol (or more precisely, encounters the name
85 of a symbol) in some text that it is reading.  There is a standard
86 obarray called `obarray' that is used for this purpose, although the
87 Lisp programmer is free to create his own obarrays and `intern' symbols
88 in them.
89
90    Note that, once a symbol is in an obarray, it stays there until
91 something is done about it, and the standard obarray `obarray' always
92 stays around, so once you use any particular variable name, a
93 corresponding symbol will stay around in `obarray' until you exit
94 XEmacs.
95
96    Note that `obarray' itself is a variable, and as such there is a
97 symbol in `obarray' whose name is `"obarray"' and which contains
98 `obarray' as its value.
99
100    Note also that this call to `intern' occurs only when in the Lisp
101 reader, not when the code is executed (at which point the symbol is
102 already around, stored as such in the definition of the function).
103
104    You can create your own obarray using `make-vector' (this is
105 horrible but is an artifact) and intern symbols into that obarray.
106 Doing that will result in two or more symbols with the same name.
107 However, at most one of these symbols is in the standard `obarray': You
108 cannot have two symbols of the same name in any particular obarray.
109 Note that you cannot add a symbol to an obarray in any fashion other
110 than using `intern': i.e. you can't take an existing symbol and put it
111 in an existing obarray.  Nor can you change the name of an existing
112 symbol. (Since obarrays are vectors, you can violate the consistency of
113 things by storing directly into the vector, but let's ignore that
114 possibility.)
115
116    Usually symbols are created by `intern', but if you really want, you
117 can explicitly create a symbol using `make-symbol', giving it some
118 name.  The resulting symbol is not in any obarray (i.e. it is
119 "uninterned"), and you can't add it to any obarray.  Therefore its
120 primary purpose is as a symbol to use in macros to avoid namespace
121 pollution.  It can also be used as a carrier of information, but cons
122 cells could probably be used just as well.
123
124    You can also use `intern-soft' to look up a symbol but not create a
125 new one, and `unintern' to remove a symbol from an obarray.  This
126 returns the removed symbol. (Remember: You can't put the symbol back
127 into any obarray.) Finally, `mapatoms' maps over all of the symbols in
128 an obarray.
129
130 \1f
131 File: internals.info,  Node: Symbol Values,  Prev: Obarrays,  Up: Symbols and Variables
132
133 Symbol Values
134 =============
135
136 The value field of a symbol normally contains a Lisp object.  However,
137 a symbol can be "unbound", meaning that it logically has no value.
138 This is internally indicated by storing a special Lisp object, called
139 "the unbound marker" and stored in the global variable `Qunbound'.  The
140 unbound marker is of a special Lisp object type called
141 "symbol-value-magic".  It is impossible for the Lisp programmer to
142 directly create or access any object of this type.
143
144    *You must not let any "symbol-value-magic" object escape to the Lisp
145 level.*  Printing any of these objects will cause the message `INTERNAL
146 EMACS BUG' to appear as part of the print representation.  (You may see
147 this normally when you call `debug_print()' from the debugger on a Lisp
148 object.) If you let one of these objects escape to the Lisp level, you
149 will violate a number of assumptions contained in the C code and make
150 the unbound marker not function right.
151
152    When a symbol is created, its value field (and function field) are
153 set to `Qunbound'.  The Lisp programmer can restore these conditions
154 later using `makunbound' or `fmakunbound', and can query to see whether
155 the value of function fields are "bound" (i.e. have a value other than
156 `Qunbound') using `boundp' and `fboundp'.  The fields are set to a
157 normal Lisp object using `set' (or `setq') and `fset'.
158
159    Other symbol-value-magic objects are used as special markers to
160 indicate variables that have non-normal properties.  This includes any
161 variables that are tied into C variables (setting the variable magically
162 sets some global variable in the C code, and likewise for retrieving the
163 variable's value), variables that magically tie into slots in the
164 current buffer, variables that are buffer-local, etc.  The
165 symbol-value-magic object is stored in the value cell in place of a
166 normal object, and the code to retrieve a symbol's value (i.e.
167 `symbol-value') knows how to do special things with them.  This means
168 that you should not just fetch the value cell directly if you want a
169 symbol's value.
170
171    The exact workings of this are rather complex and involved and are
172 well-documented in comments in `buffer.c', `symbols.c', and `lisp.h'.
173
174 \1f
175 File: internals.info,  Node: Buffers and Textual Representation,  Next: MULE Character Sets and Encodings,  Prev: Symbols and Variables,  Up: Top
176
177 Buffers and Textual Representation
178 **********************************
179
180 * Menu:
181
182 * Introduction to Buffers::     A buffer holds a block of text such as a file.
183 * The Text in a Buffer::        Representation of the text in a buffer.
184 * Buffer Lists::                Keeping track of all buffers.
185 * Markers and Extents::         Tagging locations within a buffer.
186 * Bufbytes and Emchars::        Representation of individual characters.
187 * The Buffer Object::           The Lisp object corresponding to a buffer.
188
189 \1f
190 File: internals.info,  Node: Introduction to Buffers,  Next: The Text in a Buffer,  Up: Buffers and Textual Representation
191
192 Introduction to Buffers
193 =======================
194
195 A buffer is logically just a Lisp object that holds some text.  In
196 this, it is like a string, but a buffer is optimized for frequent
197 insertion and deletion, while a string is not.  Furthermore:
198
199   1. Buffers are "permanent" objects, i.e. once you create them, they
200      remain around, and need to be explicitly deleted before they go
201      away.
202
203   2. Each buffer has a unique name, which is a string.  Buffers are
204      normally referred to by name.  In this respect, they are like
205      symbols.
206
207   3. Buffers have a default insertion position, called "point".
208      Inserting text (unless you explicitly give a position) goes at
209      point, and moves point forward past the text.  This is what is
210      going on when you type text into Emacs.
211
212   4. Buffers have lots of extra properties associated with them.
213
214   5. Buffers can be "displayed".  What this means is that there exist a
215      number of "windows", which are objects that correspond to some
216      visible section of your display, and each window has an associated
217      buffer, and the current contents of the buffer are shown in that
218      section of the display.  The redisplay mechanism (which takes care
219      of doing this) knows how to look at the text of a buffer and come
220      up with some reasonable way of displaying this.  Many of the
221      properties of a buffer control how the buffer's text is displayed.
222
223   6. One buffer is distinguished and called the "current buffer".  It is
224      stored in the variable `current_buffer'.  Buffer operations operate
225      on this buffer by default.  When you are typing text into a
226      buffer, the buffer you are typing into is always `current_buffer'.
227      Switching to a different window changes the current buffer.  Note
228      that Lisp code can temporarily change the current buffer using
229      `set-buffer' (often enclosed in a `save-excursion' so that the
230      former current buffer gets restored when the code is finished).
231      However, calling `set-buffer' will NOT cause a permanent change in
232      the current buffer.  The reason for this is that the top-level
233      event loop sets `current_buffer' to the buffer of the selected
234      window, each time it finishes executing a user command.
235
236    Make sure you understand the distinction between "current buffer"
237 and "buffer of the selected window", and the distinction between
238 "point" of the current buffer and "window-point" of the selected
239 window. (This latter distinction is explained in detail in the section
240 on windows.)
241
242 \1f
243 File: internals.info,  Node: The Text in a Buffer,  Next: Buffer Lists,  Prev: Introduction to Buffers,  Up: Buffers and Textual Representation
244
245 The Text in a Buffer
246 ====================
247
248 The text in a buffer consists of a sequence of zero or more characters.
249 A "character" is an integer that logically represents a letter,
250 number, space, or other unit of text.  Most of the characters that you
251 will typically encounter belong to the ASCII set of characters, but
252 there are also characters for various sorts of accented letters,
253 special symbols, Chinese and Japanese ideograms (i.e. Kanji, Katakana,
254 etc.), Cyrillic and Greek letters, etc.  The actual number of possible
255 characters is quite large.
256
257    For now, we can view a character as some non-negative integer that
258 has some shape that defines how it typically appears (e.g. as an
259 uppercase A). (The exact way in which a character appears depends on the
260 font used to display the character.) The internal type of characters in
261 the C code is an `Emchar'; this is just an `int', but using a symbolic
262 type makes the code clearer.
263
264    Between every character in a buffer is a "buffer position" or
265 "character position".  We can speak of the character before or after a
266 particular buffer position, and when you insert a character at a
267 particular position, all characters after that position end up at new
268 positions.  When we speak of the character "at" a position, we really
269 mean the character after the position.  (This schizophrenia between a
270 buffer position being "between" a character and "on" a character is
271 rampant in Emacs.)
272
273    Buffer positions are numbered starting at 1.  This means that
274 position 1 is before the first character, and position 0 is not valid.
275 If there are N characters in a buffer, then buffer position N+1 is
276 after the last one, and position N+2 is not valid.
277
278    The internal makeup of the Emchar integer varies depending on whether
279 we have compiled with MULE support.  If not, the Emchar integer is an
280 8-bit integer with possible values from 0 - 255.  0 - 127 are the
281 standard ASCII characters, while 128 - 255 are the characters from the
282 ISO-8859-1 character set.  If we have compiled with MULE support, an
283 Emchar is a 19-bit integer, with the various bits having meanings
284 according to a complex scheme that will be detailed later.  The
285 characters numbered 0 - 255 still have the same meanings as for the
286 non-MULE case, though.
287
288    Internally, the text in a buffer is represented in a fairly simple
289 fashion: as a contiguous array of bytes, with a "gap" of some size in
290 the middle.  Although the gap is of some substantial size in bytes,
291 there is no text contained within it: From the perspective of the text
292 in the buffer, it does not exist.  The gap logically sits at some buffer
293 position, between two characters (or possibly at the beginning or end of
294 the buffer).  Insertion of text in a buffer at a particular position is
295 always accomplished by first moving the gap to that position (i.e.
296 through some block moving of text), then writing the text into the
297 beginning of the gap, thereby shrinking the gap.  If the gap shrinks
298 down to nothing, a new gap is created. (What actually happens is that a
299 new gap is "created" at the end of the buffer's text, which requires
300 nothing more than changing a couple of indices; then the gap is "moved"
301 to the position where the insertion needs to take place by moving up in
302 memory all the text after that position.)  Similarly, deletion occurs
303 by moving the gap to the place where the text is to be deleted, and
304 then simply expanding the gap to include the deleted text.
305 ("Expanding" and "shrinking" the gap as just described means just that
306 the internal indices that keep track of where the gap is located are
307 changed.)
308
309    Note that the total amount of memory allocated for a buffer text
310 never decreases while the buffer is live.  Therefore, if you load up a
311 20-megabyte file and then delete all but one character, there will be a
312 20-megabyte gap, which won't get any smaller (except by inserting
313 characters back again).  Once the buffer is killed, the memory allocated
314 for the buffer text will be freed, but it will still be sitting on the
315 heap, taking up virtual memory, and will not be released back to the
316 operating system. (However, if you have compiled XEmacs with rel-alloc,
317 the situation is different.  In this case, the space _will_ be released
318 back to the operating system.  However, this tends to result in a
319 noticeable speed penalty.)
320
321    Astute readers may notice that the text in a buffer is represented as
322 an array of _bytes_, while (at least in the MULE case) an Emchar is a
323 19-bit integer, which clearly cannot fit in a byte.  This means (of
324 course) that the text in a buffer uses a different representation from
325 an Emchar: specifically, the 19-bit Emchar becomes a series of one to
326 four bytes.  The conversion between these two representations is complex
327 and will be described later.
328
329    In the non-MULE case, everything is very simple: An Emchar is an
330 8-bit value, which fits neatly into one byte.
331
332    If we are given a buffer position and want to retrieve the character
333 at that position, we need to follow these steps:
334
335   1. Pretend there's no gap, and convert the buffer position into a
336      "byte index" that indexes to the appropriate byte in the buffer's
337      stream of textual bytes.  By convention, byte indices begin at 1,
338      just like buffer positions.  In the non-MULE case, byte indices
339      and buffer positions are identical, since one character equals one
340      byte.
341
342   2. Convert the byte index into a "memory index", which takes the gap
343      into account.  The memory index is a direct index into the block of
344      memory that stores the text of a buffer.  This basically just
345      involves checking to see if the byte index is past the gap, and if
346      so, adding the size of the gap to it.  By convention, memory
347      indices begin at 1, just like buffer positions and byte indices,
348      and when referring to the position that is "at" the gap, we always
349      use the memory position at the _beginning_, not at the end, of the
350      gap.
351
352   3. Fetch the appropriate bytes at the determined memory position.
353
354   4. Convert these bytes into an Emchar.
355
356    In the non-Mule case, (3) and (4) boil down to a simple one-byte
357 memory access.
358
359    Note that we have defined three types of positions in a buffer:
360
361   1. "buffer positions" or "character positions", typedef `Bufpos'
362
363   2. "byte indices", typedef `Bytind'
364
365   3. "memory indices", typedef `Memind'
366
367    All three typedefs are just `int's, but defining them this way makes
368 things a lot clearer.
369
370    Most code works with buffer positions.  In particular, all Lisp code
371 that refers to text in a buffer uses buffer positions.  Lisp code does
372 not know that byte indices or memory indices exist.
373
374    Finally, we have a typedef for the bytes in a buffer.  This is a
375 `Bufbyte', which is an unsigned char.  Referring to them as Bufbytes
376 underscores the fact that we are working with a string of bytes in the
377 internal Emacs buffer representation rather than in one of a number of
378 possible alternative representations (e.g. EUC-encoded text, etc.).
379
380 \1f
381 File: internals.info,  Node: Buffer Lists,  Next: Markers and Extents,  Prev: The Text in a Buffer,  Up: Buffers and Textual Representation
382
383 Buffer Lists
384 ============
385
386 Recall earlier that buffers are "permanent" objects, i.e.  that they
387 remain around until explicitly deleted.  This entails that there is a
388 list of all the buffers in existence.  This list is actually an
389 assoc-list (mapping from the buffer's name to the buffer) and is stored
390 in the global variable `Vbuffer_alist'.
391
392    The order of the buffers in the list is important: the buffers are
393 ordered approximately from most-recently-used to least-recently-used.
394 Switching to a buffer using `switch-to-buffer', `pop-to-buffer', etc.
395 and switching windows using `other-window', etc.  usually brings the
396 new current buffer to the front of the list.  `switch-to-buffer',
397 `other-buffer', etc. look at the beginning of the list to find an
398 alternative buffer to suggest.  You can also explicitly move a buffer
399 to the end of the list using `bury-buffer'.
400
401    In addition to the global ordering in `Vbuffer_alist', each frame
402 has its own ordering of the list.  These lists always contain the same
403 elements as in `Vbuffer_alist' although possibly in a different order.
404 `buffer-list' normally returns the list for the selected frame.  This
405 allows you to work in separate frames without things interfering with
406 each other.
407
408    The standard way to look up a buffer given a name is `get-buffer',
409 and the standard way to create a new buffer is `get-buffer-create',
410 which looks up a buffer with a given name, creating a new one if
411 necessary.  These operations correspond exactly with the symbol
412 operations `intern-soft' and `intern', respectively.  You can also
413 force a new buffer to be created using `generate-new-buffer', which
414 takes a name and (if necessary) makes a unique name from this by
415 appending a number, and then creates the buffer.  This is basically
416 like the symbol operation `gensym'.
417
418 \1f
419 File: internals.info,  Node: Markers and Extents,  Next: Bufbytes and Emchars,  Prev: Buffer Lists,  Up: Buffers and Textual Representation
420
421 Markers and Extents
422 ===================
423
424 Among the things associated with a buffer are things that are logically
425 attached to certain buffer positions.  This can be used to keep track
426 of a buffer position when text is inserted and deleted, so that it
427 remains at the same spot relative to the text around it; to assign
428 properties to particular sections of text; etc.  There are two such
429 objects that are useful in this regard: they are "markers" and
430 "extents".
431
432    A "marker" is simply a flag placed at a particular buffer position,
433 which is moved around as text is inserted and deleted.  Markers are
434 used for all sorts of purposes, such as the `mark' that is the other
435 end of textual regions to be cut, copied, etc.
436
437    An "extent" is similar to two markers plus some associated
438 properties, and is used to keep track of regions in a buffer as text is
439 inserted and deleted, and to add properties (e.g. fonts) to particular
440 regions of text.  The external interface of extents is explained
441 elsewhere.
442
443    The important thing here is that markers and extents simply contain
444 buffer positions in them as integers, and every time text is inserted or
445 deleted, these positions must be updated.  In order to minimize the
446 amount of shuffling that needs to be done, the positions in markers and
447 extents (there's one per marker, two per extent) are stored in Meminds.
448 This means that they only need to be moved when the text is physically
449 moved in memory; since the gap structure tries to minimize this, it also
450 minimizes the number of marker and extent indices that need to be
451 adjusted.  Look in `insdel.c' for the details of how this works.
452
453    One other important distinction is that markers are "temporary"
454 while extents are "permanent".  This means that markers disappear as
455 soon as there are no more pointers to them, and correspondingly, there
456 is no way to determine what markers are in a buffer if you are just
457 given the buffer.  Extents remain in a buffer until they are detached
458 (which could happen as a result of text being deleted) or the buffer is
459 deleted, and primitives do exist to enumerate the extents in a buffer.
460
461 \1f
462 File: internals.info,  Node: Bufbytes and Emchars,  Next: The Buffer Object,  Prev: Markers and Extents,  Up: Buffers and Textual Representation
463
464 Bufbytes and Emchars
465 ====================
466
467 Not yet documented.
468
469 \1f
470 File: internals.info,  Node: The Buffer Object,  Prev: Bufbytes and Emchars,  Up: Buffers and Textual Representation
471
472 The Buffer Object
473 =================
474
475 Buffers contain fields not directly accessible by the Lisp programmer.
476 We describe them here, naming them by the names used in the C code.
477 Many are accessible indirectly in Lisp programs via Lisp primitives.
478
479 `name'
480      The buffer name is a string that names the buffer.  It is
481      guaranteed to be unique.  *Note Buffer Names: (lispref)Buffer
482      Names.
483
484 `save_modified'
485      This field contains the time when the buffer was last saved, as an
486      integer.  *Note Buffer Modification: (lispref)Buffer Modification.
487
488 `modtime'
489      This field contains the modification time of the visited file.  It
490      is set when the file is written or read.  Every time the buffer is
491      written to the file, this field is compared to the modification
492      time of the file.  *Note Buffer Modification: (lispref)Buffer
493      Modification.
494
495 `auto_save_modified'
496      This field contains the time when the buffer was last auto-saved.
497
498 `last_window_start'
499      This field contains the `window-start' position in the buffer as of
500      the last time the buffer was displayed in a window.
501
502 `undo_list'
503      This field points to the buffer's undo list.  *Note Undo:
504      (lispref)Undo.
505
506 `syntax_table_v'
507      This field contains the syntax table for the buffer.  *Note Syntax
508      Tables: (lispref)Syntax Tables.
509
510 `downcase_table'
511      This field contains the conversion table for converting text to
512      lower case.  *Note Case Tables: (lispref)Case Tables.
513
514 `upcase_table'
515      This field contains the conversion table for converting text to
516      upper case.  *Note Case Tables: (lispref)Case Tables.
517
518 `case_canon_table'
519      This field contains the conversion table for canonicalizing text
520      for case-folding search.  *Note Case Tables: (lispref)Case Tables.
521
522 `case_eqv_table'
523      This field contains the equivalence table for case-folding search.
524      *Note Case Tables: (lispref)Case Tables.
525
526 `display_table'
527      This field contains the buffer's display table, or `nil' if it
528      doesn't have one.  *Note Display Tables: (lispref)Display Tables.
529
530 `markers'
531      This field contains the chain of all markers that currently point
532      into the buffer.  Deletion of text in the buffer, and motion of
533      the buffer's gap, must check each of these markers and perhaps
534      update it.  *Note Markers: (lispref)Markers.
535
536 `backed_up'
537      This field is a flag that tells whether a backup file has been
538      made for the visited file of this buffer.
539
540 `mark'
541      This field contains the mark for the buffer.  The mark is a marker,
542      hence it is also included on the list `markers'.  *Note The Mark:
543      (lispref)The Mark.
544
545 `mark_active'
546      This field is non-`nil' if the buffer's mark is active.
547
548 `local_var_alist'
549      This field contains the association list describing the variables
550      local in this buffer, and their values, with the exception of
551      local variables that have special slots in the buffer object.
552      (Those slots are omitted from this table.)  *Note Buffer-Local
553      Variables: (lispref)Buffer-Local Variables.
554
555 `modeline_format'
556      This field contains a Lisp object which controls how to display
557      the mode line for this buffer.  *Note Modeline Format:
558      (lispref)Modeline Format.
559
560 `base_buffer'
561      This field holds the buffer's base buffer (if it is an indirect
562      buffer), or `nil'.
563
564 \1f
565 File: internals.info,  Node: MULE Character Sets and Encodings,  Next: The Lisp Reader and Compiler,  Prev: Buffers and Textual Representation,  Up: Top
566
567 MULE Character Sets and Encodings
568 *********************************
569
570 Recall that there are two primary ways that text is represented in
571 XEmacs.  The "buffer" representation sees the text as a series of bytes
572 (Bufbytes), with a variable number of bytes used per character.  The
573 "character" representation sees the text as a series of integers
574 (Emchars), one per character.  The character representation is a cleaner
575 representation from a theoretical standpoint, and is thus used in many
576 cases when lots of manipulations on a string need to be done.  However,
577 the buffer representation is the standard representation used in both
578 Lisp strings and buffers, and because of this, it is the "default"
579 representation that text comes in.  The reason for using this
580 representation is that it's compact and is compatible with ASCII.
581
582 * Menu:
583
584 * Character Sets::
585 * Encodings::
586 * Internal Mule Encodings::
587 * CCL::
588
589 \1f
590 File: internals.info,  Node: Character Sets,  Next: Encodings,  Up: MULE Character Sets and Encodings
591
592 Character Sets
593 ==============
594
595 A character set (or "charset") is an ordered set of characters.  A
596 particular character in a charset is indexed using one or more
597 "position codes", which are non-negative integers.  The number of
598 position codes needed to identify a particular character in a charset is
599 called the "dimension" of the charset.  In XEmacs/Mule, all charsets
600 have dimension 1 or 2, and the size of all charsets (except for a few
601 special cases) is either 94, 96, 94 by 94, or 96 by 96.  The range of
602 position codes used to index characters from any of these types of
603 character sets is as follows:
604
605      Charset type            Position code 1         Position code 2
606      ------------------------------------------------------------
607      94                      33 - 126                N/A
608      96                      32 - 127                N/A
609      94x94                   33 - 126                33 - 126
610      96x96                   32 - 127                32 - 127
611
612    Note that in the above cases position codes do not start at an
613 expected value such as 0 or 1.  The reason for this will become clear
614 later.
615
616    For example, Latin-1 is a 96-character charset, and JISX0208 (the
617 Japanese national character set) is a 94x94-character charset.
618
619    [Note that, although the ranges above define the _valid_ position
620 codes for a charset, some of the slots in a particular charset may in
621 fact be empty.  This is the case for JISX0208, for example, where (e.g.)
622 all the slots whose first position code is in the range 118 - 127 are
623 empty.]
624
625    There are three charsets that do not follow the above rules.  All of
626 them have one dimension, and have ranges of position codes as follows:
627
628      Charset name            Position code 1
629      ------------------------------------
630      ASCII                   0 - 127
631      Control-1               0 - 31
632      Composite               0 - some large number
633
634    (The upper bound of the position code for composite characters has
635 not yet been determined, but it will probably be at least 16,383).
636
637    ASCII is the union of two subsidiary character sets: Printing-ASCII
638 (the printing ASCII character set, consisting of position codes 33 -
639 126, like for a standard 94-character charset) and Control-ASCII (the
640 non-printing characters that would appear in a binary file with codes 0
641 - 32 and 127).
642
643    Control-1 contains the non-printing characters that would appear in a
644 binary file with codes 128 - 159.
645
646    Composite contains characters that are generated by overstriking one
647 or more characters from other charsets.
648
649    Note that some characters in ASCII, and all characters in Control-1,
650 are "control" (non-printing) characters.  These have no printed
651 representation but instead control some other function of the printing
652 (e.g. TAB or 8 moves the current character position to the next tab
653 stop).  All other characters in all charsets are "graphic" (printing)
654 characters.
655
656    When a binary file is read in, the bytes in the file are assigned to
657 character sets as follows:
658
659      Bytes           Character set           Range
660      --------------------------------------------------
661      0 - 127         ASCII                   0 - 127
662      128 - 159       Control-1               0 - 31
663      160 - 255       Latin-1                 32 - 127
664
665    This is a bit ad-hoc but gets the job done.
666
667 \1f
668 File: internals.info,  Node: Encodings,  Next: Internal Mule Encodings,  Prev: Character Sets,  Up: MULE Character Sets and Encodings
669
670 Encodings
671 =========
672
673 An "encoding" is a way of numerically representing characters from one
674 or more character sets.  If an encoding only encompasses one character
675 set, then the position codes for the characters in that character set
676 could be used directly.  This is not possible, however, if more than
677 one character set is to be used in the encoding.
678
679    For example, the conversion detailed above between bytes in a binary
680 file and characters is effectively an encoding that encompasses the
681 three character sets ASCII, Control-1, and Latin-1 in a stream of 8-bit
682 bytes.
683
684    Thus, an encoding can be viewed as a way of encoding characters from
685 a specified group of character sets using a stream of bytes, each of
686 which contains a fixed number of bits (but not necessarily 8, as in the
687 common usage of "byte").
688
689    Here are descriptions of a couple of common encodings:
690
691 * Menu:
692
693 * Japanese EUC (Extended Unix Code)::
694 * JIS7::
695
696 \1f
697 File: internals.info,  Node: Japanese EUC (Extended Unix Code),  Next: JIS7,  Up: Encodings
698
699 Japanese EUC (Extended Unix Code)
700 ---------------------------------
701
702 This encompasses the character sets Printing-ASCII, Japanese-JISX0201,
703 and Japanese-JISX0208-Kana (half-width katakana, the right half of
704 JISX0201).  It uses 8-bit bytes.
705
706    Note that Printing-ASCII and Japanese-JISX0201-Kana are 94-character
707 charsets, while Japanese-JISX0208 is a 94x94-character charset.
708
709    The encoding is as follows:
710
711      Character set            Representation (PC=position-code)
712      -------------            --------------
713      Printing-ASCII           PC1
714      Japanese-JISX0201-Kana   0x8E       | PC1 + 0x80
715      Japanese-JISX0208        PC1 + 0x80 | PC2 + 0x80
716      Japanese-JISX0212        PC1 + 0x80 | PC2 + 0x80
717
718 \1f
719 File: internals.info,  Node: JIS7,  Prev: Japanese EUC (Extended Unix Code),  Up: Encodings
720
721 JIS7
722 ----
723
724 This encompasses the character sets Printing-ASCII,
725 Japanese-JISX0201-Roman (the left half of JISX0201; this character set
726 is very similar to Printing-ASCII and is a 94-character charset),
727 Japanese-JISX0208, and Japanese-JISX0201-Kana.  It uses 7-bit bytes.
728
729    Unlike Japanese EUC, this is a "modal" encoding, which means that
730 there are multiple states that the encoding can be in, which affect how
731 the bytes are to be interpreted.  Special sequences of bytes (called
732 "escape sequences") are used to change states.
733
734    The encoding is as follows:
735
736      Character set              Representation (PC=position-code)
737      -------------              --------------
738      Printing-ASCII             PC1
739      Japanese-JISX0201-Roman    PC1
740      Japanese-JISX0201-Kana     PC1
741      Japanese-JISX0208          PC1 PC2
742      
743      
744      Escape sequence   ASCII equivalent   Meaning
745      ---------------   ----------------   -------
746      0x1B 0x28 0x4A    ESC ( J            invoke Japanese-JISX0201-Roman
747      0x1B 0x28 0x49    ESC ( I            invoke Japanese-JISX0201-Kana
748      0x1B 0x24 0x42    ESC $ B            invoke Japanese-JISX0208
749      0x1B 0x28 0x42    ESC ( B            invoke Printing-ASCII
750
751    Initially, Printing-ASCII is invoked.
752
753 \1f
754 File: internals.info,  Node: Internal Mule Encodings,  Next: CCL,  Prev: Encodings,  Up: MULE Character Sets and Encodings
755
756 Internal Mule Encodings
757 =======================
758
759 In XEmacs/Mule, each character set is assigned a unique number, called a
760 "leading byte".  This is used in the encodings of a character.  Leading
761 bytes are in the range 0x80 - 0xFF (except for ASCII, which has a
762 leading byte of 0), although some leading bytes are reserved.
763
764    Charsets whose leading byte is in the range 0x80 - 0x9F are called
765 "official" and are used for built-in charsets.  Other charsets are
766 called "private" and have leading bytes in the range 0xA0 - 0xFF; these
767 are user-defined charsets.
768
769    More specifically:
770
771      Character set           Leading byte
772      -------------           ------------
773      ASCII                   0
774      Composite               0x80
775      Dimension-1 Official    0x81 - 0x8D
776                                (0x8E is free)
777      Control-1               0x8F
778      Dimension-2 Official    0x90 - 0x99
779                                (0x9A - 0x9D are free;
780                                 0x9E and 0x9F are reserved)
781      Dimension-1 Private     0xA0 - 0xEF
782      Dimension-2 Private     0xF0 - 0xFF
783
784    There are two internal encodings for characters in XEmacs/Mule.  One
785 is called "string encoding" and is an 8-bit encoding that is used for
786 representing characters in a buffer or string.  It uses 1 to 4 bytes per
787 character.  The other is called "character encoding" and is a 19-bit
788 encoding that is used for representing characters individually in a
789 variable.
790
791    (In the following descriptions, we'll ignore composite characters for
792 the moment.  We also give a general (structural) overview first,
793 followed later by the exact details.)
794
795 * Menu:
796
797 * Internal String Encoding::
798 * Internal Character Encoding::
799
800 \1f
801 File: internals.info,  Node: Internal String Encoding,  Next: Internal Character Encoding,  Up: Internal Mule Encodings
802
803 Internal String Encoding
804 ------------------------
805
806 ASCII characters are encoded using their position code directly.  Other
807 characters are encoded using their leading byte followed by their
808 position code(s) with the high bit set.  Characters in private character
809 sets have their leading byte prefixed with a "leading byte prefix",
810 which is either 0x9E or 0x9F. (No character sets are ever assigned these
811 leading bytes.) Specifically:
812
813      Character set           Encoding (PC=position-code, LB=leading-byte)
814      -------------           --------
815      ASCII                   PC-1 |
816      Control-1               LB   |  PC1 + 0xA0 |
817      Dimension-1 official    LB   |  PC1 + 0x80 |
818      Dimension-1 private     0x9E |  LB         | PC1 + 0x80 |
819      Dimension-2 official    LB   |  PC1 + 0x80 | PC2 + 0x80 |
820      Dimension-2 private     0x9F |  LB         | PC1 + 0x80 | PC2 + 0x80
821
822    The basic characteristic of this encoding is that the first byte of
823 all characters is in the range 0x00 - 0x9F, and the second and
824 following bytes of all characters is in the range 0xA0 - 0xFF.  This
825 means that it is impossible to get out of sync, or more specifically:
826
827   1. Given any byte position, the beginning of the character it is
828      within can be determined in constant time.
829
830   2. Given any byte position at the beginning of a character, the
831      beginning of the next character can be determined in constant time.
832
833   3. Given any byte position at the beginning of a character, the
834      beginning of the previous character can be determined in constant
835      time.
836
837   4. Textual searches can simply treat encoded strings as if they were
838      encoded in a one-byte-per-character fashion rather than the actual
839      multi-byte encoding.
840
841    None of the standard non-modal encodings meet all of these
842 conditions.  For example, EUC satisfies only (2) and (3), while
843 Shift-JIS and Big5 (not yet described) satisfy only (2). (All non-modal
844 encodings must satisfy (2), in order to be unambiguous.)
845
846 \1f
847 File: internals.info,  Node: Internal Character Encoding,  Prev: Internal String Encoding,  Up: Internal Mule Encodings
848
849 Internal Character Encoding
850 ---------------------------
851
852 One 19-bit word represents a single character.  The word is separated
853 into three fields:
854
855      Bit number:     18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
856                      <------------> <------------------> <------------------>
857      Field:                1                  2                    3
858
859    Note that fields 2 and 3 hold 7 bits each, while field 1 holds 5
860 bits.
861
862      Character set           Field 1         Field 2         Field 3
863      -------------           -------         -------         -------
864      ASCII                      0               0              PC1
865         range:                                                   (00 - 7F)
866      Control-1                  0               1              PC1
867         range:                                                   (00 - 1F)
868      Dimension-1 official       0            LB - 0x80         PC1
869         range:                                    (01 - 0D)      (20 - 7F)
870      Dimension-1 private        0            LB - 0x80         PC1
871         range:                                    (20 - 6F)      (20 - 7F)
872      Dimension-2 official    LB - 0x8F         PC1             PC2
873         range:                    (01 - 0A)       (20 - 7F)      (20 - 7F)
874      Dimension-2 private     LB - 0xE1         PC1             PC2
875         range:                    (0F - 1E)       (20 - 7F)      (20 - 7F)
876      Composite                 0x1F             ?               ?
877
878    Note that character codes 0 - 255 are the same as the "binary
879 encoding" described above.
880
881 \1f
882 File: internals.info,  Node: CCL,  Prev: Internal Mule Encodings,  Up: MULE Character Sets and Encodings
883
884 CCL
885 ===
886
887      CCL PROGRAM SYNTAX:
888           CCL_PROGRAM := (CCL_MAIN_BLOCK
889                           [ CCL_EOF_BLOCK ])
890      
891           CCL_MAIN_BLOCK := CCL_BLOCK
892           CCL_EOF_BLOCK := CCL_BLOCK
893      
894           CCL_BLOCK := STATEMENT | (STATEMENT [STATEMENT ...])
895           STATEMENT :=
896                   SET | IF | BRANCH | LOOP | REPEAT | BREAK
897                   | READ | WRITE
898      
899           SET := (REG = EXPRESSION) | (REG SELF_OP EXPRESSION)
900                  | INT-OR-CHAR
901      
902           EXPRESSION := ARG | (EXPRESSION OP ARG)
903      
904           IF := (if EXPRESSION CCL_BLOCK CCL_BLOCK)
905           BRANCH := (branch EXPRESSION CCL_BLOCK [CCL_BLOCK ...])
906           LOOP := (loop STATEMENT [STATEMENT ...])
907           BREAK := (break)
908           REPEAT := (repeat)
909                   | (write-repeat [REG | INT-OR-CHAR | string])
910                   | (write-read-repeat REG [INT-OR-CHAR | string | ARRAY]?)
911           READ := (read REG) | (read REG REG)
912                   | (read-if REG ARITH_OP ARG CCL_BLOCK CCL_BLOCK)
913                   | (read-branch REG CCL_BLOCK [CCL_BLOCK ...])
914           WRITE := (write REG) | (write REG REG)
915                   | (write INT-OR-CHAR) | (write STRING) | STRING
916                   | (write REG ARRAY)
917           END := (end)
918      
919           REG := r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7
920           ARG := REG | INT-OR-CHAR
921           OP :=   + | - | * | / | % | & | '|' | ^ | << | >> | <8 | >8 | //
922                   | < | > | == | <= | >= | !=
923           SELF_OP :=
924                   += | -= | *= | /= | %= | &= | '|=' | ^= | <<= | >>=
925           ARRAY := '[' INT-OR-CHAR ... ']'
926           INT-OR-CHAR := INT | CHAR
927      
928      MACHINE CODE:
929      
930      The machine code consists of a vector of 32-bit words.
931      The first such word specifies the start of the EOF section of the code;
932      this is the code executed to handle any stuff that needs to be done
933      (e.g. designating back to ASCII and left-to-right mode) after all
934      other encoded/decoded data has been written out.  This is not used for
935      charset CCL programs.
936      
937      REGISTER: 0..7  -- referred by RRR or rrr
938      
939      OPERATOR BIT FIELD (27-bit): XXXXXXXXXXXXXXX RRR TTTTT
940              TTTTT (5-bit): operator type
941              RRR (3-bit): register number
942              XXXXXXXXXXXXXXXX (15-bit):
943                      CCCCCCCCCCCCCCC: constant or address
944                      000000000000rrr: register number
945      
946      AAAA:   00000 +
947              00001 -
948              00010 *
949              00011 /
950              00100 %
951              00101 &
952              00110 |
953              00111 ~
954      
955              01000 <<
956              01001 >>
957              01010 <8
958              01011 >8
959              01100 //
960              01101 not used
961              01110 not used
962              01111 not used
963      
964              10000 <
965              10001 >
966              10010 ==
967              10011 <=
968              10100 >=
969              10101 !=
970      
971      OPERATORS:      TTTTT RRR XX..
972      
973      SetCS:          00000 RRR C...C      RRR = C...C
974      SetCL:          00001 RRR .....      RRR = c...c
975                      c.............c
976      SetR:           00010 RRR ..rrr      RRR = rrr
977      SetA:           00011 RRR ..rrr      RRR = array[rrr]
978                      C.............C      size of array = C...C
979                      c.............c      contents = c...c
980      
981      Jump:           00100 000 c...c      jump to c...c
982      JumpCond:       00101 RRR c...c      if (!RRR) jump to c...c
983      WriteJump:      00110 RRR c...c      Write1 RRR, jump to c...c
984      WriteReadJump:  00111 RRR c...c      Write1, Read1 RRR, jump to c...c
985      WriteCJump:     01000 000 c...c      Write1 C...C, jump to c...c
986                      C...C
987      WriteCReadJump: 01001 RRR c...c      Write1 C...C, Read1 RRR,
988                      C.............C      and jump to c...c
989      WriteSJump:     01010 000 c...c      WriteS, jump to c...c
990                      C.............C
991                      S.............S
992                      ...
993      WriteSReadJump: 01011 RRR c...c      WriteS, Read1 RRR, jump to c...c
994                      C.............C
995                      S.............S
996                      ...
997      WriteAReadJump: 01100 RRR c...c      WriteA, Read1 RRR, jump to c...c
998                      C.............C      size of array = C...C
999                      c.............c      contents = c...c
1000                      ...
1001      Branch:         01101 RRR C...C      if (RRR >= 0 && RRR < C..)
1002                      c.............c      branch to (RRR+1)th address
1003      Read1:          01110 RRR ...        read 1-byte to RRR
1004      Read2:          01111 RRR ..rrr      read 2-byte to RRR and rrr
1005      ReadBranch:     10000 RRR C...C      Read1 and Branch
1006                      c.............c
1007                      ...
1008      Write1:         10001 RRR .....      write 1-byte RRR
1009      Write2:         10010 RRR ..rrr      write 2-byte RRR and rrr
1010      WriteC:         10011 000 .....      write 1-char C...CC
1011                      C.............C
1012      WriteS:         10100 000 .....      write C..-byte of string
1013                      C.............C
1014                      S.............S
1015                      ...
1016      WriteA:         10101 RRR .....      write array[RRR]
1017                      C.............C      size of array = C...C
1018                      c.............c      contents = c...c
1019                      ...
1020      End:            10110 000 .....      terminate the execution
1021      
1022      SetSelfCS:      10111 RRR C...C      RRR AAAAA= C...C
1023                      ..........AAAAA
1024      SetSelfCL:      11000 RRR .....      RRR AAAAA= c...c
1025                      c.............c
1026                      ..........AAAAA
1027      SetSelfR:       11001 RRR ..Rrr      RRR AAAAA= rrr
1028                      ..........AAAAA
1029      SetExprCL:      11010 RRR ..Rrr      RRR = rrr AAAAA c...c
1030                      c.............c
1031                      ..........AAAAA
1032      SetExprR:       11011 RRR ..rrr      RRR = rrr AAAAA Rrr
1033                      ............Rrr
1034                      ..........AAAAA
1035      JumpCondC:      11100 RRR c...c      if !(RRR AAAAA C..) jump to c...c
1036                      C.............C
1037                      ..........AAAAA
1038      JumpCondR:      11101 RRR c...c      if !(RRR AAAAA rrr) jump to c...c
1039                      ............rrr
1040                      ..........AAAAA
1041      ReadJumpCondC:  11110 RRR c...c      Read1 and JumpCondC
1042                      C.............C
1043                      ..........AAAAA
1044      ReadJumpCondR:  11111 RRR c...c      Read1 and JumpCondR
1045                      ............rrr
1046                      ..........AAAAA
1047
1048 \1f
1049 File: internals.info,  Node: The Lisp Reader and Compiler,  Next: Lstreams,  Prev: MULE Character Sets and Encodings,  Up: Top
1050
1051 The Lisp Reader and Compiler
1052 ****************************
1053
1054 Not yet documented.
1055
1056 \1f
1057 File: internals.info,  Node: Lstreams,  Next: Consoles; Devices; Frames; Windows,  Prev: The Lisp Reader and Compiler,  Up: Top
1058
1059 Lstreams
1060 ********
1061
1062 An "lstream" is an internal Lisp object that provides a generic
1063 buffering stream implementation.  Conceptually, you send data to the
1064 stream or read data from the stream, not caring what's on the other end
1065 of the stream.  The other end could be another stream, a file
1066 descriptor, a stdio stream, a fixed block of memory, a reallocating
1067 block of memory, etc.  The main purpose of the stream is to provide a
1068 standard interface and to do buffering.  Macros are defined to read or
1069 write characters, so the calling functions do not have to worry about
1070 blocking data together in order to achieve efficiency.
1071
1072 * Menu:
1073
1074 * Creating an Lstream::         Creating an lstream object.
1075 * Lstream Types::               Different sorts of things that are streamed.
1076 * Lstream Functions::           Functions for working with lstreams.
1077 * Lstream Methods::             Creating new lstream types.
1078
1079 \1f
1080 File: internals.info,  Node: Creating an Lstream,  Next: Lstream Types,  Up: Lstreams
1081
1082 Creating an Lstream
1083 ===================
1084
1085 Lstreams come in different types, depending on what is being interfaced
1086 to.  Although the primitive for creating new lstreams is
1087 `Lstream_new()', generally you do not call this directly.  Instead, you
1088 call some type-specific creation function, which creates the lstream
1089 and initializes it as appropriate for the particular type.
1090
1091    All lstream creation functions take a MODE argument, specifying what
1092 mode the lstream should be opened as.  This controls whether the
1093 lstream is for input and output, and optionally whether data should be
1094 blocked up in units of MULE characters.  Note that some types of
1095 lstreams can only be opened for input; others only for output; and
1096 others can be opened either way.  #### Richard Mlynarik thinks that
1097 there should be a strict separation between input and output streams,
1098 and he's probably right.
1099
1100    MODE is a string, one of
1101
1102 `"r"'
1103      Open for reading.
1104
1105 `"w"'
1106      Open for writing.
1107
1108 `"rc"'
1109      Open for reading, but "read" never returns partial MULE characters.
1110
1111 `"wc"'
1112      Open for writing, but never writes partial MULE characters.
1113
1114 \1f
1115 File: internals.info,  Node: Lstream Types,  Next: Lstream Functions,  Prev: Creating an Lstream,  Up: Lstreams
1116
1117 Lstream Types
1118 =============
1119
1120 stdio
1121
1122 filedesc
1123
1124 lisp-string
1125
1126 fixed-buffer
1127
1128 resizing-buffer
1129
1130 dynarr
1131
1132 lisp-buffer
1133
1134 print
1135
1136 decoding
1137
1138 encoding
1139
1140 \1f
1141 File: internals.info,  Node: Lstream Functions,  Next: Lstream Methods,  Prev: Lstream Types,  Up: Lstreams
1142
1143 Lstream Functions
1144 =================
1145
1146  - Function: Lstream * Lstream_new (Lstream_implementation *IMP, const
1147           char *MODE)
1148      Allocate and return a new Lstream.  This function is not really
1149      meant to be called directly; rather, each stream type should
1150      provide its own stream creation function, which creates the stream
1151      and does any other necessary creation stuff (e.g. opening a file).
1152
1153  - Function: void Lstream_set_buffering (Lstream *LSTR,
1154           Lstream_buffering BUFFERING, int BUFFERING_SIZE)
1155      Change the buffering of a stream.  See `lstream.h'.  By default the
1156      buffering is `STREAM_BLOCK_BUFFERED'.
1157
1158  - Function: int Lstream_flush (Lstream *LSTR)
1159      Flush out any pending unwritten data in the stream.  Clear any
1160      buffered input data.  Returns 0 on success, -1 on error.
1161
1162  - Macro: int Lstream_putc (Lstream *STREAM, int C)
1163      Write out one byte to the stream.  This is a macro and so it is
1164      very efficient.  The C argument is only evaluated once but the
1165      STREAM argument is evaluated more than once.  Returns 0 on
1166      success, -1 on error.
1167
1168  - Macro: int Lstream_getc (Lstream *STREAM)
1169      Read one byte from the stream.  This is a macro and so it is very
1170      efficient.  The STREAM argument is evaluated more than once.
1171      Return value is -1 for EOF or error.
1172
1173  - Macro: void Lstream_ungetc (Lstream *STREAM, int C)
1174      Push one byte back onto the input queue.  This will be the next
1175      byte read from the stream.  Any number of bytes can be pushed back
1176      and will be read in the reverse order they were pushed back--most
1177      recent first. (This is necessary for consistency--if there are a
1178      number of bytes that have been unread and I read and unread a
1179      byte, it needs to be the first to be read again.) This is a macro
1180      and so it is very efficient.  The C argument is only evaluated
1181      once but the STREAM argument is evaluated more than once.
1182
1183  - Function: int Lstream_fputc (Lstream *STREAM, int C)
1184  - Function: int Lstream_fgetc (Lstream *STREAM)
1185  - Function: void Lstream_fungetc (Lstream *STREAM, int C)
1186      Function equivalents of the above macros.
1187
1188  - Function: ssize_t Lstream_read (Lstream *STREAM, void *DATA, size_t
1189           SIZE)
1190      Read SIZE bytes of DATA from the stream.  Return the number of
1191      bytes read.  0 means EOF. -1 means an error occurred and no bytes
1192      were read.
1193
1194  - Function: ssize_t Lstream_write (Lstream *STREAM, void *DATA, size_t
1195           SIZE)
1196      Write SIZE bytes of DATA to the stream.  Return the number of
1197      bytes written.  -1 means an error occurred and no bytes were
1198      written.
1199
1200  - Function: void Lstream_unread (Lstream *STREAM, void *DATA, size_t
1201           SIZE)
1202      Push back SIZE bytes of DATA onto the input queue.  The next call
1203      to `Lstream_read()' with the same size will read the same bytes
1204      back.  Note that this will be the case even if there is other
1205      pending unread data.
1206
1207  - Function: int Lstream_close (Lstream *STREAM)
1208      Close the stream.  All data will be flushed out.
1209
1210  - Function: void Lstream_reopen (Lstream *STREAM)
1211      Reopen a closed stream.  This enables I/O on it again.  This is not
1212      meant to be called except from a wrapper routine that reinitializes
1213      variables and such--the close routine may well have freed some
1214      necessary storage structures, for example.
1215
1216  - Function: void Lstream_rewind (Lstream *STREAM)
1217      Rewind the stream to the beginning.
1218
1219 \1f
1220 File: internals.info,  Node: Lstream Methods,  Prev: Lstream Functions,  Up: Lstreams
1221
1222 Lstream Methods
1223 ===============
1224
1225  - Lstream Method: ssize_t reader (Lstream *STREAM, unsigned char
1226           *DATA, size_t SIZE)
1227      Read some data from the stream's end and store it into DATA, which
1228      can hold SIZE bytes.  Return the number of bytes read.  A return
1229      value of 0 means no bytes can be read at this time.  This may be
1230      because of an EOF, or because there is a granularity greater than
1231      one byte that the stream imposes on the returned data, and SIZE is
1232      less than this granularity. (This will happen frequently for
1233      streams that need to return whole characters, because
1234      `Lstream_read()' calls the reader function repeatedly until it has
1235      the number of bytes it wants or until 0 is returned.)  The lstream
1236      functions do not treat a 0 return as EOF or do anything special;
1237      however, the calling function will interpret any 0 it gets back as
1238      EOF.  This will normally not happen unless the caller calls
1239      `Lstream_read()' with a very small size.
1240
1241      This function can be `NULL' if the stream is output-only.
1242
1243  - Lstream Method: ssize_t writer (Lstream *STREAM, const unsigned char
1244           *DATA, size_t SIZE)
1245      Send some data to the stream's end.  Data to be sent is in DATA
1246      and is SIZE bytes.  Return the number of bytes sent.  This
1247      function can send and return fewer bytes than is passed in; in that
1248      case, the function will just be called again until there is no
1249      data left or 0 is returned.  A return value of 0 means that no
1250      more data can be currently stored, but there is no error; the data
1251      will be squirreled away until the writer can accept data. (This is
1252      useful, e.g., if you're dealing with a non-blocking file
1253      descriptor and are getting `EWOULDBLOCK' errors.)  This function
1254      can be `NULL' if the stream is input-only.
1255
1256  - Lstream Method: int rewinder (Lstream *STREAM)
1257      Rewind the stream.  If this is `NULL', the stream is not seekable.
1258
1259  - Lstream Method: int seekable_p (Lstream *STREAM)
1260      Indicate whether this stream is seekable--i.e. it can be rewound.
1261      This method is ignored if the stream does not have a rewind
1262      method.  If this method is not present, the result is determined
1263      by whether a rewind method is present.
1264
1265  - Lstream Method: int flusher (Lstream *STREAM)
1266      Perform any additional operations necessary to flush the data in
1267      this stream.
1268
1269  - Lstream Method: int pseudo_closer (Lstream *STREAM)
1270
1271  - Lstream Method: int closer (Lstream *STREAM)
1272      Perform any additional operations necessary to close this stream
1273      down.  May be `NULL'.  This function is called when
1274      `Lstream_close()' is called or when the stream is
1275      garbage-collected.  When this function is called, all pending data
1276      in the stream will already have been written out.
1277
1278  - Lstream Method: Lisp_Object marker (Lisp_Object LSTREAM, void
1279           (*MARKFUN) (Lisp_Object))
1280      Mark this object for garbage collection.  Same semantics as a
1281      standard `Lisp_Object' marker.  This function can be `NULL'.
1282
1283 \1f
1284 File: internals.info,  Node: Consoles; Devices; Frames; Windows,  Next: The Redisplay Mechanism,  Prev: Lstreams,  Up: Top
1285
1286 Consoles; Devices; Frames; Windows
1287 **********************************
1288
1289 * Menu:
1290
1291 * Introduction to Consoles; Devices; Frames; Windows::
1292 * Point::
1293 * Window Hierarchy::
1294 * The Window Object::
1295
1296 \1f
1297 File: internals.info,  Node: Introduction to Consoles; Devices; Frames; Windows,  Next: Point,  Up: Consoles; Devices; Frames; Windows
1298
1299 Introduction to Consoles; Devices; Frames; Windows
1300 ==================================================
1301
1302 A window-system window that you see on the screen is called a "frame"
1303 in Emacs terminology.  Each frame is subdivided into one or more
1304 non-overlapping panes, called (confusingly) "windows".  Each window
1305 displays the text of a buffer in it. (See above on Buffers.) Note that
1306 buffers and windows are independent entities: Two or more windows can
1307 be displaying the same buffer (potentially in different locations), and
1308 a buffer can be displayed in no windows.
1309
1310    A single display screen that contains one or more frames is called a
1311 "display".  Under most circumstances, there is only one display.
1312 However, more than one display can exist, for example if you have a
1313 "multi-headed" console, i.e. one with a single keyboard but multiple
1314 displays. (Typically in such a situation, the various displays act like
1315 one large display, in that the mouse is only in one of them at a time,
1316 and moving the mouse off of one moves it into another.) In some cases,
1317 the different displays will have different characteristics, e.g. one
1318 color and one mono.
1319
1320    XEmacs can display frames on multiple displays.  It can even deal
1321 simultaneously with frames on multiple keyboards (called "consoles" in
1322 XEmacs terminology).  Here is one case where this might be useful: You
1323 are using XEmacs on your workstation at work, and leave it running.
1324 Then you go home and dial in on a TTY line, and you can use the
1325 already-running XEmacs process to display another frame on your local
1326 TTY.
1327
1328    Thus, there is a hierarchy console -> display -> frame -> window.
1329 There is a separate Lisp object type for each of these four concepts.
1330 Furthermore, there is logically a "selected console", "selected
1331 display", "selected frame", and "selected window".  Each of these
1332 objects is distinguished in various ways, such as being the default
1333 object for various functions that act on objects of that type.  Note
1334 that every containing object remembers the "selected" object among the
1335 objects that it contains: e.g. not only is there a selected window, but
1336 every frame remembers the last window in it that was selected, and
1337 changing the selected frame causes the remembered window within it to
1338 become the selected window.  Similar relationships apply for consoles
1339 to devices and devices to frames.
1340
1341 \1f
1342 File: internals.info,  Node: Point,  Next: Window Hierarchy,  Prev: Introduction to Consoles; Devices; Frames; Windows,  Up: Consoles; Devices; Frames; Windows
1343
1344 Point
1345 =====
1346
1347 Recall that every buffer has a current insertion position, called
1348 "point".  Now, two or more windows may be displaying the same buffer,
1349 and the text cursor in the two windows (i.e. `point') can be in two
1350 different places.  You may ask, how can that be, since each buffer has
1351 only one value of `point'?  The answer is that each window also has a
1352 value of `point' that is squirreled away in it.  There is only one
1353 selected window, and the value of "point" in that buffer corresponds to
1354 that window.  When the selected window is changed from one window to
1355 another displaying the same buffer, the old value of `point' is stored
1356 into the old window's "point" and the value of `point' from the new
1357 window is retrieved and made the value of `point' in the buffer.  This
1358 means that `window-point' for the selected window is potentially
1359 inaccurate, and if you want to retrieve the correct value of `point'
1360 for a window, you must special-case on the selected window and retrieve
1361 the buffer's point instead.  This is related to why
1362 `save-window-excursion' does not save the selected window's value of
1363 `point'.
1364
1365 \1f
1366 File: internals.info,  Node: Window Hierarchy,  Next: The Window Object,  Prev: Point,  Up: Consoles; Devices; Frames; Windows
1367
1368 Window Hierarchy
1369 ================
1370
1371 If a frame contains multiple windows (panes), they are always created
1372 by splitting an existing window along the horizontal or vertical axis.
1373 Terminology is a bit confusing here: to "split a window horizontally"
1374 means to create two side-by-side windows, i.e. to make a _vertical_ cut
1375 in a window.  Likewise, to "split a window vertically" means to create
1376 two windows, one above the other, by making a _horizontal_ cut.
1377
1378    If you split a window and then split again along the same axis, you
1379 will end up with a number of panes all arranged along the same axis.
1380 The precise way in which the splits were made should not be important,
1381 and this is reflected internally.  Internally, all windows are arranged
1382 in a tree, consisting of two types of windows, "combination" windows
1383 (which have children, and are covered completely by those children) and
1384 "leaf" windows, which have no children and are visible.  Every
1385 combination window has two or more children, all arranged along the same
1386 axis.  There are (logically) two subtypes of windows, depending on
1387 whether their children are horizontally or vertically arrayed.  There is
1388 always one root window, which is either a leaf window (if the frame
1389 contains only one window) or a combination window (if the frame contains
1390 more than one window).  In the latter case, the root window will have
1391 two or more children, either horizontally or vertically arrayed, and
1392 each of those children will be either a leaf window or another
1393 combination window.
1394
1395    Here are some rules:
1396
1397   1. Horizontal combination windows can never have children that are
1398      horizontal combination windows; same for vertical.
1399
1400   2. Only leaf windows can be split (obviously) and this splitting does
1401      one of two things: (a) turns the leaf window into a combination
1402      window and creates two new leaf children, or (b) turns the leaf
1403      window into one of the two new leaves and creates the other leaf.
1404      Rule (1) dictates which of these two outcomes happens.
1405
1406   3. Every combination window must have at least two children.
1407
1408   4. Leaf windows can never become combination windows.  They can be
1409      deleted, however.  If this results in a violation of (3), the
1410      parent combination window also gets deleted.
1411
1412   5. All functions that accept windows must be prepared to accept
1413      combination windows, and do something sane (e.g. signal an error
1414      if so).  Combination windows _do_ escape to the Lisp level.
1415
1416   6. All windows have three fields governing their contents: these are
1417      "hchild" (a list of horizontally-arrayed children), "vchild" (a
1418      list of vertically-arrayed children), and "buffer" (the buffer
1419      contained in a leaf window).  Exactly one of these will be
1420      non-`nil'.  Remember that "horizontally-arrayed" means
1421      "side-by-side" and "vertically-arrayed" means "one above the
1422      other".
1423
1424   7. Leaf windows also have markers in their `start' (the first buffer
1425      position displayed in the window) and `pointm' (the window's
1426      stashed value of `point'--see above) fields, while combination
1427      windows have `nil' in these fields.
1428
1429   8. The list of children for a window is threaded through the `next'
1430      and `prev' fields of each child window.
1431
1432   9. *Deleted windows can be undeleted*.  This happens as a result of
1433      restoring a window configuration, and is unlike frames, displays,
1434      and consoles, which, once deleted, can never be restored.
1435      Deleting a window does nothing except set a special `dead' bit to
1436      1 and clear out the `next', `prev', `hchild', and `vchild' fields,
1437      for GC purposes.
1438
1439  10. Most frames actually have two top-level windows--one for the
1440      minibuffer and one (the "root") for everything else.  The modeline
1441      (if present) separates these two.  The `next' field of the root
1442      points to the minibuffer, and the `prev' field of the minibuffer
1443      points to the root.  The other `next' and `prev' fields are `nil',
1444      and the frame points to both of these windows.  Minibuffer-less
1445      frames have no minibuffer window, and the `next' and `prev' of the
1446      root window are `nil'.  Minibuffer-only frames have no root
1447      window, and the `next' of the minibuffer window is `nil' but the
1448      `prev' points to itself. (#### This is an artifact that should be
1449      fixed.)
1450
1451 \1f
1452 File: internals.info,  Node: The Window Object,  Prev: Window Hierarchy,  Up: Consoles; Devices; Frames; Windows
1453
1454 The Window Object
1455 =================
1456
1457 Windows have the following accessible fields:
1458
1459 `frame'
1460      The frame that this window is on.
1461
1462 `mini_p'
1463      Non-`nil' if this window is a minibuffer window.
1464
1465 `buffer'
1466      The buffer that the window is displaying.  This may change often
1467      during the life of the window.
1468
1469 `dedicated'
1470      Non-`nil' if this window is dedicated to its buffer.
1471
1472 `pointm'
1473      This is the value of point in the current buffer when this window
1474      is selected; when it is not selected, it retains its previous
1475      value.
1476
1477 `start'
1478      The position in the buffer that is the first character to be
1479      displayed in the window.
1480
1481 `force_start'
1482      If this flag is non-`nil', it says that the window has been
1483      scrolled explicitly by the Lisp program.  This affects what the
1484      next redisplay does if point is off the screen: instead of
1485      scrolling the window to show the text around point, it moves point
1486      to a location that is on the screen.
1487
1488 `last_modified'
1489      The `modified' field of the window's buffer, as of the last time a
1490      redisplay completed in this window.
1491
1492 `last_point'
1493      The buffer's value of point, as of the last time a redisplay
1494      completed in this window.
1495
1496 `left'
1497      This is the left-hand edge of the window, measured in columns.
1498      (The leftmost column on the screen is column 0.)
1499
1500 `top'
1501      This is the top edge of the window, measured in lines.  (The top
1502      line on the screen is line 0.)
1503
1504 `height'
1505      The height of the window, measured in lines.
1506
1507 `width'
1508      The width of the window, measured in columns.
1509
1510 `next'
1511      This is the window that is the next in the chain of siblings.  It
1512      is `nil' in a window that is the rightmost or bottommost of a
1513      group of siblings.
1514
1515 `prev'
1516      This is the window that is the previous in the chain of siblings.
1517      It is `nil' in a window that is the leftmost or topmost of a group
1518      of siblings.
1519
1520 `parent'
1521      Internally, XEmacs arranges windows in a tree; each group of
1522      siblings has a parent window whose area includes all the siblings.
1523      This field points to a window's parent.
1524
1525      Parent windows do not display buffers, and play little role in
1526      display except to shape their child windows.  Emacs Lisp programs
1527      usually have no access to the parent windows; they operate on the
1528      windows at the leaves of the tree, which actually display buffers.
1529
1530 `hscroll'
1531      This is the number of columns that the display in the window is
1532      scrolled horizontally to the left.  Normally, this is 0.
1533
1534 `use_time'
1535      This is the last time that the window was selected.  The function
1536      `get-lru-window' uses this field.
1537
1538 `display_table'
1539      The window's display table, or `nil' if none is specified for it.
1540
1541 `update_mode_line'
1542      Non-`nil' means this window's mode line needs to be updated.
1543
1544 `base_line_number'
1545      The line number of a certain position in the buffer, or `nil'.
1546      This is used for displaying the line number of point in the mode
1547      line.
1548
1549 `base_line_pos'
1550      The position in the buffer for which the line number is known, or
1551      `nil' meaning none is known.
1552
1553 `region_showing'
1554      If the region (or part of it) is highlighted in this window, this
1555      field holds the mark position that made one end of that region.
1556      Otherwise, this field is `nil'.
1557
1558 \1f
1559 File: internals.info,  Node: The Redisplay Mechanism,  Next: Extents,  Prev: Consoles; Devices; Frames; Windows,  Up: Top
1560
1561 The Redisplay Mechanism
1562 ***********************
1563
1564 The redisplay mechanism is one of the most complicated sections of
1565 XEmacs, especially from a conceptual standpoint.  This is doubly so
1566 because, unlike for the basic aspects of the Lisp interpreter, the
1567 computer science theories of how to efficiently handle redisplay are not
1568 well-developed.
1569
1570    When working with the redisplay mechanism, remember the Golden Rules
1571 of Redisplay:
1572
1573   1. It Is Better To Be Correct Than Fast.
1574
1575   2. Thou Shalt Not Run Elisp From Within Redisplay.
1576
1577   3. It Is Better To Be Fast Than Not To Be.
1578
1579 * Menu:
1580
1581 * Critical Redisplay Sections::
1582 * Line Start Cache::
1583 * Redisplay Piece by Piece::
1584
1585 \1f
1586 File: internals.info,  Node: Critical Redisplay Sections,  Next: Line Start Cache,  Up: The Redisplay Mechanism
1587
1588 Critical Redisplay Sections
1589 ===========================
1590
1591 Within this section, we are defenseless and assume that the following
1592 cannot happen:
1593
1594   1. garbage collection
1595
1596   2. Lisp code evaluation
1597
1598   3. frame size changes
1599
1600    We ensure (3) by calling `hold_frame_size_changes()', which will
1601 cause any pending frame size changes to get put on hold till after the
1602 end of the critical section.  (1) follows automatically if (2) is met.
1603 #### Unfortunately, there are some places where Lisp code can be called
1604 within this section.  We need to remove them.
1605
1606    If `Fsignal()' is called during this critical section, we will
1607 `abort()'.
1608
1609    If garbage collection is called during this critical section, we
1610 simply return. #### We should abort instead.
1611
1612    #### If a frame-size change does occur we should probably actually
1613 be preempting redisplay.
1614
1615 \1f
1616 File: internals.info,  Node: Line Start Cache,  Next: Redisplay Piece by Piece,  Prev: Critical Redisplay Sections,  Up: The Redisplay Mechanism
1617
1618 Line Start Cache
1619 ================
1620
1621 The traditional scrolling code in Emacs breaks in a variable height
1622 world.  It depends on the key assumption that the number of lines that
1623 can be displayed at any given time is fixed.  This led to a complete
1624 separation of the scrolling code from the redisplay code.  In order to
1625 fully support variable height lines, the scrolling code must actually be
1626 tightly integrated with redisplay.  Only redisplay can determine how
1627 many lines will be displayed on a screen for any given starting point.
1628
1629    What is ideally wanted is a complete list of the starting buffer
1630 position for every possible display line of a buffer along with the
1631 height of that display line.  Maintaining such a full list would be very
1632 expensive.  We settle for having it include information for all areas
1633 which we happen to generate anyhow (i.e. the region currently being
1634 displayed) and for those areas we need to work with.
1635
1636    In order to ensure that the cache accurately represents what
1637 redisplay would actually show, it is necessary to invalidate it in many
1638 situations.  If the buffer changes, the starting positions may no longer
1639 be correct.  If a face or an extent has changed then the line heights
1640 may have altered.  These events happen frequently enough that the cache
1641 can end up being constantly disabled.  With this potentially constant
1642 invalidation when is the cache ever useful?
1643
1644    Even if the cache is invalidated before every single usage, it is
1645 necessary.  Scrolling often requires knowledge about display lines which
1646 are actually above or below the visible region.  The cache provides a
1647 convenient light-weight method of storing this information for multiple
1648 display regions.  This knowledge is necessary for the scrolling code to
1649 always obey the First Golden Rule of Redisplay.
1650
1651    If the cache already contains all of the information that the
1652 scrolling routines happen to need so that it doesn't have to go
1653 generate it, then we are able to obey the Third Golden Rule of
1654 Redisplay.  The first thing we do to help out the cache is to always
1655 add the displayed region.  This region had to be generated anyway, so
1656 the cache ends up getting the information basically for free.  In those
1657 cases where a user is simply scrolling around viewing a buffer there is
1658 a high probability that this is sufficient to always provide the needed
1659 information.  The second thing we can do is be smart about invalidating
1660 the cache.
1661
1662    TODO--Be smart about invalidating the cache.  Potential places:
1663
1664    * Insertions at end-of-line which don't cause line-wraps do not
1665      alter the starting positions of any display lines.  These types of
1666      buffer modifications should not invalidate the cache.  This is
1667      actually a large optimization for redisplay speed as well.
1668
1669    * Buffer modifications frequently only affect the display of lines
1670      at and below where they occur.  In these situations we should only
1671      invalidate the part of the cache starting at where the
1672      modification occurs.
1673
1674    In case you're wondering, the Second Golden Rule of Redisplay is not
1675 applicable.
1676
1677 \1f
1678 File: internals.info,  Node: Redisplay Piece by Piece,  Prev: Line Start Cache,  Up: The Redisplay Mechanism
1679
1680 Redisplay Piece by Piece
1681 ========================
1682
1683 As you can begin to see redisplay is complex and also not well
1684 documented. Chuck no longer works on XEmacs so this section is my take
1685 on the workings of redisplay.
1686
1687    Redisplay happens in three phases:
1688
1689   1. Determine desired display in area that needs redisplay.
1690      Implemented by `redisplay.c'
1691
1692   2. Compare desired display with current display Implemented by
1693      `redisplay-output.c'
1694
1695   3. Output changes Implemented by `redisplay-output.c',
1696      `redisplay-x.c', `redisplay-msw.c' and `redisplay-tty.c'
1697
1698    Steps 1 and 2 are device-independent and relatively complex.  Step 3
1699 is mostly device-dependent.
1700
1701    Determining the desired display
1702
1703    Display attributes are stored in `display_line' structures. Each
1704 `display_line' consists of a set of `display_block''s and each
1705 `display_block' contains a number of `rune''s. Generally dynarr's of
1706 `display_line''s are held by each window representing the current
1707 display and the desired display.
1708
1709    The `display_line' structures are tightly tied to buffers which
1710 presents a problem for redisplay as this connection is bogus for the
1711 modeline. Hence the `display_line' generation routines are duplicated
1712 for generating the modeline. This means that the modeline display code
1713 has many bugs that the standard redisplay code does not.
1714
1715    The guts of `display_line' generation are in `create_text_block',
1716 which creates a single display line for the desired locale. This
1717 incrementally parses the characters on the current line and generates
1718 redisplay structures for each.
1719
1720    Gutter redisplay is different. Because the data to display is stored
1721 in a string we cannot use `create_text_block'. Instead we use
1722 `create_text_string_block' which performs the same function as
1723 `create_text_block' but for strings. Many of the complexities of
1724 `create_text_block' to do with cursor handling and selective display
1725 have been removed.
1726
1727 \1f
1728 File: internals.info,  Node: Extents,  Next: Faces,  Prev: The Redisplay Mechanism,  Up: Top
1729
1730 Extents
1731 *******
1732
1733 * Menu:
1734
1735 * Introduction to Extents::     Extents are ranges over text, with properties.
1736 * Extent Ordering::             How extents are ordered internally.
1737 * Format of the Extent Info::   The extent information in a buffer or string.
1738 * Zero-Length Extents::         A weird special case.
1739 * Mathematics of Extent Ordering::  A rigorous foundation.
1740 * Extent Fragments::            Cached information useful for redisplay.
1741
1742 \1f
1743 File: internals.info,  Node: Introduction to Extents,  Next: Extent Ordering,  Up: Extents
1744
1745 Introduction to Extents
1746 =======================
1747
1748 Extents are regions over a buffer, with a start and an end position
1749 denoting the region of the buffer included in the extent.  In addition,
1750 either end can be closed or open, meaning that the endpoint is or is
1751 not logically included in the extent.  Insertion of a character at a
1752 closed endpoint causes the character to go inside the extent; insertion
1753 at an open endpoint causes the character to go outside.
1754
1755    Extent endpoints are stored using memory indices (see `insdel.c'),
1756 to minimize the amount of adjusting that needs to be done when
1757 characters are inserted or deleted.
1758
1759    (Formerly, extent endpoints at the gap could be either before or
1760 after the gap, depending on the open/closedness of the endpoint.  The
1761 intent of this was to make it so that insertions would automatically go
1762 inside or out of extents as necessary with no further work needing to
1763 be done.  It didn't work out that way, however, and just ended up
1764 complexifying and buggifying all the rest of the code.)
1765
1766 \1f
1767 File: internals.info,  Node: Extent Ordering,  Next: Format of the Extent Info,  Prev: Introduction to Extents,  Up: Extents
1768
1769 Extent Ordering
1770 ===============
1771
1772 Extents are compared using memory indices.  There are two orderings for
1773 extents and both orders are kept current at all times.  The normal or
1774 "display" order is as follows:
1775
1776      Extent A is ``less than'' extent B,
1777      that is, earlier in the display order,
1778        if:    A-start < B-start,
1779        or if: A-start = B-start, and A-end > B-end
1780
1781    So if two extents begin at the same position, the larger of them is
1782 the earlier one in the display order (`EXTENT_LESS' is true).
1783
1784    For the e-order, the same thing holds:
1785
1786      Extent A is ``less than'' extent B in e-order,
1787      that is, later in the buffer,
1788        if:    A-end < B-end,
1789        or if: A-end = B-end, and A-start > B-start
1790
1791    So if two extents end at the same position, the smaller of them is
1792 the earlier one in the e-order (`EXTENT_E_LESS' is true).
1793
1794    The display order and the e-order are complementary orders: any
1795 theorem about the display order also applies to the e-order if you swap
1796 all occurrences of "display order" and "e-order", "less than" and
1797 "greater than", and "extent start" and "extent end".
1798
1799 \1f
1800 File: internals.info,  Node: Format of the Extent Info,  Next: Zero-Length Extents,  Prev: Extent Ordering,  Up: Extents
1801
1802 Format of the Extent Info
1803 =========================
1804
1805 An extent-info structure consists of a list of the buffer or string's
1806 extents and a "stack of extents" that lists all of the extents over a
1807 particular position.  The stack-of-extents info is used for
1808 optimization purposes--it basically caches some info that might be
1809 expensive to compute.  Certain otherwise hard computations are easy
1810 given the stack of extents over a particular position, and if the stack
1811 of extents over a nearby position is known (because it was calculated
1812 at some prior point in time), it's easy to move the stack of extents to
1813 the proper position.
1814
1815    Given that the stack of extents is an optimization, and given that
1816 it requires memory, a string's stack of extents is wiped out each time
1817 a garbage collection occurs.  Therefore, any time you retrieve the
1818 stack of extents, it might not be there.  If you need it to be there,
1819 use the `_force' version.
1820
1821    Similarly, a string may or may not have an extent_info structure.
1822 (Generally it won't if there haven't been any extents added to the
1823 string.) So use the `_force' version if you need the extent_info
1824 structure to be there.
1825
1826    A list of extents is maintained as a double gap array: one gap array
1827 is ordered by start index (the "display order") and the other is
1828 ordered by end index (the "e-order").  Note that positions in an extent
1829 list should logically be conceived of as referring _to_ a particular
1830 extent (as is the norm in programs) rather than sitting between two
1831 extents.  Note also that callers of these functions should not be aware
1832 of the fact that the extent list is implemented as an array, except for
1833 the fact that positions are integers (this should be generalized to
1834 handle integers and linked list equally well).
1835
1836 \1f
1837 File: internals.info,  Node: Zero-Length Extents,  Next: Mathematics of Extent Ordering,  Prev: Format of the Extent Info,  Up: Extents
1838
1839 Zero-Length Extents
1840 ===================
1841
1842 Extents can be zero-length, and will end up that way if their endpoints
1843 are explicitly set that way or if their detachable property is `nil'
1844 and all the text in the extent is deleted. (The exception is open-open
1845 zero-length extents, which are barred from existing because there is no
1846 sensible way to define their properties.  Deletion of the text in an
1847 open-open extent causes it to be converted into a closed-open extent.)
1848 Zero-length extents are primarily used to represent annotations, and
1849 behave as follows:
1850
1851   1. Insertion at the position of a zero-length extent expands the
1852      extent if both endpoints are closed; goes after the extent if it
1853      is closed-open; and goes before the extent if it is open-closed.
1854
1855   2. Deletion of a character on a side of a zero-length extent whose
1856      corresponding endpoint is closed causes the extent to be detached
1857      if it is detachable; if the extent is not detachable or the
1858      corresponding endpoint is open, the extent remains in the buffer,
1859      moving as necessary.
1860
1861    Note that closed-open, non-detachable zero-length extents behave
1862 exactly like markers and that open-closed, non-detachable zero-length
1863 extents behave like the "point-type" marker in Mule.
1864
1865 \1f
1866 File: internals.info,  Node: Mathematics of Extent Ordering,  Next: Extent Fragments,  Prev: Zero-Length Extents,  Up: Extents
1867
1868 Mathematics of Extent Ordering
1869 ==============================
1870
1871 The extents in a buffer are ordered by "display order" because that is
1872 that order that the redisplay mechanism needs to process them in.  The
1873 e-order is an auxiliary ordering used to facilitate operations over
1874 extents.  The operations that can be performed on the ordered list of
1875 extents in a buffer are
1876
1877   1. Locate where an extent would go if inserted into the list.
1878
1879   2. Insert an extent into the list.
1880
1881   3. Remove an extent from the list.
1882
1883   4. Map over all the extents that overlap a range.
1884
1885    (4) requires being able to determine the first and last extents that
1886 overlap a range.
1887
1888    NOTE: "overlap" is used as follows:
1889
1890    * two ranges overlap if they have at least one point in common.
1891      Whether the endpoints are open or closed makes a difference here.
1892
1893    * a point overlaps a range if the point is contained within the
1894      range; this is equivalent to treating a point P as the range [P,
1895      P].
1896
1897    * In the case of an _extent_ overlapping a point or range, the extent
1898      is normally treated as having closed endpoints.  This applies
1899      consistently in the discussion of stacks of extents and such below.
1900      Note that this definition of overlap is not necessarily consistent
1901      with the extents that `map-extents' maps over, since `map-extents'
1902      sometimes pays attention to whether the endpoints of an extents
1903      are open or closed.  But for our purposes, it greatly simplifies
1904      things to treat all extents as having closed endpoints.
1905
1906    First, define >, <, <=, etc. as applied to extents to mean
1907 comparison according to the display order.  Comparison between an
1908 extent E and an index I means comparison between E and the range [I, I].
1909
1910    Also define e>, e<, e<=, etc. to mean comparison according to the
1911 e-order.
1912
1913    For any range R, define R(0) to be the starting index of the range
1914 and R(1) to be the ending index of the range.
1915
1916    For any extent E, define E(next) to be the extent directly following
1917 E, and E(prev) to be the extent directly preceding E.  Assume E(next)
1918 and E(prev) can be determined from E in constant time.  (This is
1919 because we store the extent list as a doubly linked list.)
1920
1921    Similarly, define E(e-next) and E(e-prev) to be the extents directly
1922 following and preceding E in the e-order.
1923
1924    Now:
1925
1926    Let R be a range.  Let F be the first extent overlapping R.  Let L
1927 be the last extent overlapping R.
1928
1929    Theorem 1: R(1) lies between L and L(next), i.e. L <= R(1) < L(next).
1930
1931    This follows easily from the definition of display order.  The basic
1932 reason that this theorem applies is that the display order sorts by
1933 increasing starting index.
1934
1935    Therefore, we can determine L just by looking at where we would
1936 insert R(1) into the list, and if we know F and are moving forward over
1937 extents, we can easily determine when we've hit L by comparing the
1938 extent we're at to R(1).
1939
1940      Theorem 2: F(e-prev) e< [1, R(0)] e<= F.
1941
1942    This is the analog of Theorem 1, and applies because the e-order
1943 sorts by increasing ending index.
1944
1945    Therefore, F can be found in the same amount of time as operation
1946 (1), i.e. the time that it takes to locate where an extent would go if
1947 inserted into the e-order list.
1948
1949    If the lists were stored as balanced binary trees, then operation (1)
1950 would take logarithmic time, which is usually quite fast.  However,
1951 currently they're stored as simple doubly-linked lists, and instead we
1952 do some caching to try to speed things up.
1953
1954    Define a "stack of extents" (or "SOE") as the set of extents
1955 (ordered in the display order) that overlap an index I, together with
1956 the SOE's "previous" extent, which is an extent that precedes I in the
1957 e-order. (Hopefully there will not be very many extents between I and
1958 the previous extent.)
1959
1960    Now:
1961
1962    Let I be an index, let S be the stack of extents on I, let F be the
1963 first extent in S, and let P be S's previous extent.
1964
1965    Theorem 3: The first extent in S is the first extent that overlaps
1966 any range [I, J].
1967
1968    Proof: Any extent that overlaps [I, J] but does not include I must
1969 have a start index > I, and thus be greater than any extent in S.
1970
1971    Therefore, finding the first extent that overlaps a range R is the
1972 same as finding the first extent that overlaps R(0).
1973
1974    Theorem 4: Let I2 be an index such that I2 > I, and let F2 be the
1975 first extent that overlaps I2.  Then, either F2 is in S or F2 is
1976 greater than any extent in S.
1977
1978    Proof: If F2 does not include I then its start index is greater than
1979 I and thus it is greater than any extent in S, including F.  Otherwise,
1980 F2 includes I and thus is in S, and thus F2 >= F.
1981
1982 \1f
1983 File: internals.info,  Node: Extent Fragments,  Prev: Mathematics of Extent Ordering,  Up: Extents
1984
1985 Extent Fragments
1986 ================
1987
1988 Imagine that the buffer is divided up into contiguous, non-overlapping
1989 "runs" of text such that no extent starts or ends within a run (extents
1990 that abut the run don't count).
1991
1992    An extent fragment is a structure that holds data about the run that
1993 contains a particular buffer position (if the buffer position is at the
1994 junction of two runs, the run after the position is used)--the
1995 beginning and end of the run, a list of all of the extents in that run,
1996 the "merged face" that results from merging all of the faces
1997 corresponding to those extents, the begin and end glyphs at the
1998 beginning of the run, etc.  This is the information that redisplay needs
1999 in order to display this run.
2000
2001    Extent fragments have to be very quick to update to a new buffer
2002 position when moving linearly through the buffer.  They rely on the
2003 stack-of-extents code, which does the heavy-duty algorithmic work of
2004 determining which extents overly a particular position.
2005
2006 \1f
2007 File: internals.info,  Node: Faces,  Next: Glyphs,  Prev: Extents,  Up: Top
2008
2009 Faces
2010 *****
2011
2012 Not yet documented.
2013
2014 \1f
2015 File: internals.info,  Node: Glyphs,  Next: Specifiers,  Prev: Faces,  Up: Top
2016
2017 Glyphs
2018 ******
2019
2020 Glyphs are graphical elements that can be displayed in XEmacs buffers or
2021 gutters. We use the term graphical element here in the broadest possible
2022 sense since glyphs can be as mundane as text or as arcane as a native
2023 tab widget.
2024
2025    In XEmacs, glyphs represent the uninstantiated state of graphical
2026 elements, i.e. they hold all the information necessary to produce an
2027 image on-screen but the image need not exist at this stage, and multiple
2028 screen images can be instantiated from a single glyph.
2029
2030    Glyphs are lazily instantiated by calling one of the glyph
2031 functions. This usually occurs within redisplay when `Fglyph_height' is
2032 called. Instantiation causes an image-instance to be created and
2033 cached. This cache is on a per-device basis for all glyphs except
2034 widget-glyphs, and on a per-window basis for widgets-glyphs.  The
2035 caching is done by `image_instantiate' and is necessary because it is
2036 generally possible to display an image-instance in multiple domains.
2037 For instance if we create a Pixmap, we can actually display this on
2038 multiple windows - even though we only need a single Pixmap instance to
2039 do this. If caching wasn't done then it would be necessary to create
2040 image-instances for every displayable occurrence of a glyph - and every
2041 usage - and this would be extremely memory and cpu intensive.
2042
2043    Widget-glyphs (a.k.a native widgets) are not cached in this way.
2044 This is because widget-glyph image-instances on screen are toolkit
2045 windows, and thus cannot be reused in multiple XEmacs domains. Thus
2046 widget-glyphs are cached on an XEmacs window basis.
2047
2048    Any action on a glyph first consults the cache before actually
2049 instantiating a widget.
2050
2051 Glyph Instantiation
2052 ===================
2053
2054 Glyph instantiation is a hairy topic and requires some explanation. The
2055 guts of glyph instantiation is contained within `image_instantiate'. A
2056 glyph contains an image which is a specifier. When a glyph function -
2057 for instance `Fglyph_height' - asks for a property of the glyph that
2058 can only be determined from its instantiated state, then the glyph
2059 image is instantiated and an image instance created. The instantiation
2060 process is governed by the specifier code and goes through a series of
2061 steps:
2062
2063    * Validation. Instantiation of image instances happens dynamically -
2064      often within the guts of redisplay. Thus it is often not feasible
2065      to catch instantiator errors at instantiation time. Instead the
2066      instantiator is validated at the time it is added to the image
2067      specifier. This function is defined by `image_validate' and at a
2068      simple level validates keyword value pairs.
2069
2070    * Duplication. The specifier code by default takes a copy of the
2071      instantiator. This is reasonable for most specifiers but in the
2072      case of widget-glyphs can be problematic, since some of the
2073      properties in the instantiator - for instance callbacks - could
2074      cause infinite recursion in the copying process. Thus the image
2075      code defines a function - `image_copy_instantiator' - which will
2076      selectively copy values.  This is controlled by the way that a
2077      keyword is defined either using `IIFORMAT_VALID_KEYWORD' or
2078      `IIFORMAT_VALID_NONCOPY_KEYWORD'. Note that the image caching and
2079      redisplay code relies on instantiator copying to ensure that
2080      current and new instantiators are actually different rather than
2081      referring to the same thing.
2082
2083    * Normalization. Once the instantiator has been copied it must be
2084      converted into a form that is viable at instantiation time. This
2085      can involve no changes at all, but typically involves things like
2086      converting file names to the actual data. This function is defined
2087      by `image_going_to_add' and `normalize_image_instantiator'.
2088
2089    * Instantiation. When an image instance is actually required for
2090      display it is instantiated using `image_instantiate'. This
2091      involves calling instantiate methods that are specific to the type
2092      of image being instantiated.
2093
2094    The final instantiation phase also involves a number of steps. In
2095 order to understand these we need to describe a number of concepts.
2096
2097    An image is instantiated in a "domain", where a domain can be any
2098 one of a device, frame, window or image-instance. The domain gives the
2099 image-instance context and identity and properties that affect the
2100 appearance of the image-instance may be different for the same glyph
2101 instantiated in different domains. An example is the face used to
2102 display the image-instance.
2103
2104    Although an image is instantiated in a particular domain the
2105 instantiation domain is not necessarily the domain in which the
2106 image-instance is cached. For example a pixmap can be instantiated in a
2107 window be actually be cached on a per-device basis. The domain in which
2108 the image-instance is actually cached is called the "governing-domain".
2109 A governing-domain is currently either a device or a window.
2110 Widget-glyphs and text-glyphs have a window as a governing-domain, all
2111 other image-instances have a device as the governing-domain. The
2112 governing domain for an image-instance is determined using the
2113 governing_domain image-instance method.
2114
2115 Widget-Glyphs
2116 =============
2117
2118 Widget-Glyphs in the MS-Windows Environment
2119 ===========================================
2120
2121 To Do
2122
2123 Widget-Glyphs in the X Environment
2124 ==================================
2125
2126 Widget-glyphs under X make heavy use of lwlib (*note Lucid Widget
2127 Library::) for manipulating the native toolkit objects. This is
2128 primarily so that different toolkits can be supported for
2129 widget-glyphs, just as they are supported for features such as menubars
2130 etc.
2131
2132    Lwlib is extremely poorly documented and quite hairy so here is my
2133 understanding of what goes on.
2134
2135    Lwlib maintains a set of widget_instances which mirror the
2136 hierarchical state of Xt widgets. I think this is so that widgets can
2137 be updated and manipulated generically by the lwlib library. For
2138 instance update_one_widget_instance can cope with multiple types of
2139 widget and multiple types of toolkit. Each element in the widget
2140 hierarchy is updated from its corresponding widget_instance by walking
2141 the widget_instance tree recursively.
2142
2143    This has desirable properties such as lw_modify_all_widgets which is
2144 called from `glyphs-x.c' and updates all the properties of a widget
2145 without having to know what the widget is or what toolkit it is from.
2146 Unfortunately this also has hairy properties such as making the lwlib
2147 code quite complex. And of course lwlib has to know at some level what
2148 the widget is and how to set its properties.
2149
2150 \1f
2151 File: internals.info,  Node: Specifiers,  Next: Menus,  Prev: Glyphs,  Up: Top
2152
2153 Specifiers
2154 **********
2155
2156 Not yet documented.
2157
2158 \1f
2159 File: internals.info,  Node: Menus,  Next: Subprocesses,  Prev: Specifiers,  Up: Top
2160
2161 Menus
2162 *****
2163
2164 A menu is set by setting the value of the variable `current-menubar'
2165 (which may be buffer-local) and then calling `set-menubar-dirty-flag'
2166 to signal a change.  This will cause the menu to be redrawn at the next
2167 redisplay.  The format of the data in `current-menubar' is described in
2168 `menubar.c'.
2169
2170    Internally the data in current-menubar is parsed into a tree of
2171 `widget_value's' (defined in `lwlib.h'); this is accomplished by the
2172 recursive function `menu_item_descriptor_to_widget_value()', called by
2173 `compute_menubar_data()'.  Such a tree is deallocated using
2174 `free_widget_value()'.
2175
2176    `update_screen_menubars()' is one of the external entry points.
2177 This checks to see, for each screen, if that screen's menubar needs to
2178 be updated.  This is the case if
2179
2180   1. `set-menubar-dirty-flag' was called since the last redisplay.
2181      (This function sets the C variable menubar_has_changed.)
2182
2183   2. The buffer displayed in the screen has changed.
2184
2185   3. The screen has no menubar currently displayed.
2186
2187    `set_screen_menubar()' is called for each such screen.  This
2188 function calls `compute_menubar_data()' to create the tree of
2189 widget_value's, then calls `lw_create_widget()',
2190 `lw_modify_all_widgets()', and/or `lw_destroy_all_widgets()' to create
2191 the X-Toolkit widget associated with the menu.
2192
2193    `update_psheets()', the other external entry point, actually changes
2194 the menus being displayed.  It uses the widgets fixed by
2195 `update_screen_menubars()' and calls various X functions to ensure that
2196 the menus are displayed properly.
2197
2198    The menubar widget is set up so that `pre_activate_callback()' is
2199 called when the menu is first selected (i.e. mouse button goes down),
2200 and `menubar_selection_callback()' is called when an item is selected.
2201 `pre_activate_callback()' calls the function in activate-menubar-hook,
2202 which can change the menubar (this is described in `menubar.c').  If
2203 the menubar is changed, `set_screen_menubars()' is called.
2204 `menubar_selection_callback()' enqueues a menu event, putting in it a
2205 function to call (either `eval' or `call-interactively') and its
2206 argument, which is the callback function or form given in the menu's
2207 description.
2208
2209 \1f
2210 File: internals.info,  Node: Subprocesses,  Next: Interface to the X Window System,  Prev: Menus,  Up: Top
2211
2212 Subprocesses
2213 ************
2214
2215 The fields of a process are:
2216
2217 `name'
2218      A string, the name of the process.
2219
2220 `command'
2221      A list containing the command arguments that were used to start
2222      this process.
2223
2224 `filter'
2225      A function used to accept output from the process instead of a
2226      buffer, or `nil'.
2227
2228 `sentinel'
2229      A function called whenever the process receives a signal, or `nil'.
2230
2231 `buffer'
2232      The associated buffer of the process.
2233
2234 `pid'
2235      An integer, the Unix process ID.
2236
2237 `childp'
2238      A flag, non-`nil' if this is really a child process.  It is `nil'
2239      for a network connection.
2240
2241 `mark'
2242      A marker indicating the position of the end of the last output
2243      from this process inserted into the buffer.  This is often but not
2244      always the end of the buffer.
2245
2246 `kill_without_query'
2247      If this is non-`nil', killing XEmacs while this process is still
2248      running does not ask for confirmation about killing the process.
2249
2250 `raw_status_low'
2251 `raw_status_high'
2252      These two fields record 16 bits each of the process status
2253      returned by the `wait' system call.
2254
2255 `status'
2256      The process status, as `process-status' should return it.
2257
2258 `tick'
2259 `update_tick'
2260      If these two fields are not equal, a change in the status of the
2261      process needs to be reported, either by running the sentinel or by
2262      inserting a message in the process buffer.
2263
2264 `pty_flag'
2265      Non-`nil' if communication with the subprocess uses a PTY; `nil'
2266      if it uses a pipe.
2267
2268 `infd'
2269      The file descriptor for input from the process.
2270
2271 `outfd'
2272      The file descriptor for output to the process.
2273
2274 `subtty'
2275      The file descriptor for the terminal that the subprocess is using.
2276      (On some systems, there is no need to record this, so the value is
2277      `-1'.)
2278
2279 `tty_name'
2280      The name of the terminal that the subprocess is using, or `nil' if
2281      it is using pipes.
2282
2283 \1f
2284 File: internals.info,  Node: Interface to the X Window System,  Next: Index,  Prev: Subprocesses,  Up: Top
2285
2286 Interface to the X Window System
2287 ********************************
2288
2289 Mostly undocumented.
2290
2291 * Menu:
2292
2293 * Lucid Widget Library::        An interface to various widget sets.
2294
2295 \1f
2296 File: internals.info,  Node: Lucid Widget Library,  Up: Interface to the X Window System
2297
2298 Lucid Widget Library
2299 ====================
2300
2301 Lwlib is extremely poorly documented and quite hairy.  The author(s)
2302 blame that on X, Xt, and Motif, with some justice, but also sufficient
2303 hypocrisy to avoid drawing the obvious conclusion about their own work.
2304
2305    The Lucid Widget Library is composed of two more or less independent
2306 pieces.  The first, as the name suggests, is a set of widgets.  These
2307 widgets are intended to resemble and improve on widgets provided in the
2308 Motif toolkit but not in the Athena widgets, including menubars and
2309 scrollbars.  Recent additions by Andy Piper integrate some "modern"
2310 widgets by Edward Falk, including checkboxes, radio buttons, progress
2311 gauges, and index tab controls (aka notebooks).
2312
2313    The second piece of the Lucid widget library is a generic interface
2314 to several toolkits for X (including Xt, the Athena widget set, and
2315 Motif, as well as the Lucid widgets themselves) so that core XEmacs
2316 code need not know which widget set has been used to build the
2317 graphical user interface.
2318
2319 * Menu:
2320
2321 * Generic Widget Interface::    The lwlib generic widget interface.
2322 * Scrollbars::
2323 * Menubars::
2324 * Checkboxes and Radio Buttons::
2325 * Progress Bars::
2326 * Tab Controls::
2327
2328 \1f
2329 File: internals.info,  Node: Generic Widget Interface,  Next: Scrollbars,  Up: Lucid Widget Library
2330
2331 Generic Widget Interface
2332 ------------------------
2333
2334 In general in any toolkit a widget may be a composite object.  In Xt,
2335 all widgets have an X window that they manage, but typically a complex
2336 widget will have widget children, each of which manages a subwindow of
2337 the parent widget's X window.  These children may themselves be
2338 composite widgets.  Thus a widget is actually a tree or hierarchy of
2339 widgets.
2340
2341    For each toolkit widget, lwlib maintains a tree of `widget_values'
2342 which mirror the hierarchical state of Xt widgets (including Motif,
2343 Athena, 3D Athena, and Falk's widget sets).  Each `widget_value' has
2344 `contents' member, which points to the head of a linked list of its
2345 children.  The linked list of siblings is chained through the `next'
2346 member of `widget_value'.
2347
2348                 +-----------+
2349                 | composite |
2350                 +-----------+
2351                       |
2352                       | contents
2353                       V
2354                   +-------+ next +-------+ next +-------+
2355                   | child |----->| child |----->| child |
2356                   +-------+      +-------+      +-------+
2357                                      |
2358                                      | contents
2359                                      V
2360                               +-------------+ next +-------------+
2361                               | grand child |----->| grand child |
2362                               +-------------+      +-------------+
2363      
2364      The `widget_value' hierarchy of a composite widget with two simple
2365      children and one composite child.
2366
2367    The `widget_instance' structure maintains the inverse view of the
2368 tree.  As for the `widget_value', siblings are chained through the
2369 `next' member.  However, rather than naming children, the
2370 `widget_instance' tree links to parents.
2371
2372                 +-----------+
2373                 | composite |
2374                 +-----------+
2375                       A
2376                       | parent
2377                       |
2378                   +-------+ next +-------+ next +-------+
2379                   | child |----->| child |----->| child |
2380                   +-------+      +-------+      +-------+
2381                                      A
2382                                      | parent
2383                                      |
2384                               +-------------+ next +-------------+
2385                               | grand child |----->| grand child |
2386                               +-------------+      +-------------+
2387      
2388      The `widget_value' hierarchy of a composite widget with two simple
2389      children and one composite child.
2390
2391    This permits widgets derived from different toolkits to be updated
2392 and manipulated generically by the lwlib library. For instance
2393 `update_one_widget_instance' can cope with multiple types of widget and
2394 multiple types of toolkit. Each element in the widget hierarchy is
2395 updated from its corresponding `widget_value' by walking the
2396 `widget_value' tree.  This has desirable properties.  For example,
2397 `lw_modify_all_widgets' is called from `glyphs-x.c' and updates all the
2398 properties of a widget without having to know what the widget is or
2399 what toolkit it is from.  Unfortunately this also has its hairy
2400 properties; the lwlib code quite complex. And of course lwlib has to
2401 know at some level what the widget is and how to set its properties.
2402
2403    The `widget_instance' structure also contains a pointer to the root
2404 of its tree.  Widget instances are further confi
2405
2406 \1f
2407 File: internals.info,  Node: Scrollbars,  Next: Menubars,  Prev: Generic Widget Interface,  Up: Lucid Widget Library
2408
2409 Scrollbars
2410 ----------
2411
2412 \1f
2413 File: internals.info,  Node: Menubars,  Next: Checkboxes and Radio Buttons,  Prev: Scrollbars,  Up: Lucid Widget Library
2414
2415 Menubars
2416 --------
2417
2418 \1f
2419 File: internals.info,  Node: Checkboxes and Radio Buttons,  Next: Progress Bars,  Prev: Menubars,  Up: Lucid Widget Library
2420
2421 Checkboxes and Radio Buttons
2422 ----------------------------
2423
2424 \1f
2425 File: internals.info,  Node: Progress Bars,  Next: Tab Controls,  Prev: Checkboxes and Radio Buttons,  Up: Lucid Widget Library
2426
2427 Progress Bars
2428 -------------
2429
2430 \1f
2431 File: internals.info,  Node: Tab Controls,  Prev: Progress Bars,  Up: Lucid Widget Library
2432
2433 Tab Controls
2434 ------------
2435
2436 \1f
2437 File: internals.info,  Node: Index,  Prev: Interface to the X Window System,  Up: Top
2438
2439 Index
2440 *****
2441
2442 * Menu:
2443
2444 * allocation from frob blocks:           Allocation from Frob Blocks.
2445 * allocation of objects in XEmacs Lisp:  Allocation of Objects in XEmacs Lisp.
2446 * allocation, introduction to:           Introduction to Allocation.
2447 * allocation, low-level:                 Low-level allocation.
2448 * Amdahl Corporation:                    XEmacs.
2449 * Andreessen, Marc:                      XEmacs.
2450 * asynchronous subprocesses:             Modules for Interfacing with the Operating System.
2451 * bars, progress:                        Progress Bars.
2452 * Baur, Steve:                           XEmacs.
2453 * Benson, Eric:                          Lucid Emacs.
2454 * binding; the specbinding stack; unwind-protects, dynamic: Dynamic Binding; The specbinding Stack; Unwind-Protects.
2455 * bindings, evaluation; stack frames;:   Evaluation; Stack Frames; Bindings.
2456 * bit vector:                            Bit Vector.
2457 * bridge, playing:                       XEmacs From the Outside.
2458 * Buchholz, Martin:                      XEmacs.
2459 * Bufbyte:                               Character-Related Data Types.
2460 * Bufbytes and Emchars:                  Bufbytes and Emchars.
2461 * buffer lists:                          Buffer Lists.
2462 * buffer object, the:                    The Buffer Object.
2463 * buffer, the text in a:                 The Text in a Buffer.
2464 * buffers and textual representation:    Buffers and Textual Representation.
2465 * buffers, introduction to:              Introduction to Buffers.
2466 * Bufpos:                                Character-Related Data Types.
2467 * building, XEmacs from the perspective of: XEmacs From the Perspective of Building.
2468 * buttons, checkboxes and radio:         Checkboxes and Radio Buttons.
2469 * byte positions, working with character and: Working With Character and Byte Positions.
2470 * Bytecount:                             Character-Related Data Types.
2471 * bytecount_to_charcount:                Working With Character and Byte Positions.
2472 * Bytind:                                Character-Related Data Types.
2473 * C code, rules when writing new:        Rules When Writing New C Code.
2474 * C vs. Lisp:                            The Lisp Language.
2475 * callback routines, the event stream:   The Event Stream Callback Routines.
2476 * caller-protects (GCPRO rule):          Writing Lisp Primitives.
2477 * case table:                            Modules for Other Aspects of the Lisp Interpreter and Object System.
2478 * catch and throw:                       Catch and Throw.
2479 * CCL:                                   CCL.
2480 * character and byte positions, working with: Working With Character and Byte Positions.
2481 * character encoding, internal:          Internal Character Encoding.
2482 * character sets:                        Character Sets.
2483 * character sets and encodings, Mule:    MULE Character Sets and Encodings.
2484 * character-related data types:          Character-Related Data Types.
2485 * characters, integers and:              Integers and Characters.
2486 * Charcount:                             Character-Related Data Types.
2487 * charcount_to_bytecount:                Working With Character and Byte Positions.
2488 * charptr_emchar:                        Working With Character and Byte Positions.
2489 * charptr_n_addr:                        Working With Character and Byte Positions.
2490 * checkboxes and radio buttons:          Checkboxes and Radio Buttons.
2491 * closer:                                Lstream Methods.
2492 * closure:                               The XEmacs Object System (Abstractly Speaking).
2493 * code, an example of Mule-aware:        An Example of Mule-Aware Code.
2494 * code, general guidelines for writing Mule-aware: General Guidelines for Writing Mule-Aware Code.
2495 * code, rules when writing new C:        Rules When Writing New C Code.
2496 * coding conventions:                    A Reader's Guide to XEmacs Coding Conventions.
2497 * coding for Mule:                       Coding for Mule.
2498 * coding rules, general:                 General Coding Rules.
2499 * coding rules, naming:                  A Reader's Guide to XEmacs Coding Conventions.
2500 * command builder, dispatching events; the: Dispatching Events; The Command Builder.
2501 * comments, writing good:                Writing Good Comments.
2502 * Common Lisp:                           The Lisp Language.
2503 * compact_string_chars:                  compact_string_chars.
2504 * compiled function:                     Compiled Function.
2505 * compiler, the Lisp reader and:         The Lisp Reader and Compiler.
2506 * cons:                                  Cons.
2507 * conservative garbage collection:       GCPROing.
2508 * consoles; devices; frames; windows:    Consoles; Devices; Frames; Windows.
2509 * consoles; devices; frames; windows, introduction to: Introduction to Consoles; Devices; Frames; Windows.
2510 * control flow modules, editor-level:    Editor-Level Control Flow Modules.
2511 * conversion to and from external data:  Conversion to and from External Data.
2512 * converting events:                     Converting Events.
2513 * copy-on-write:                         General Coding Rules.
2514 * creating Lisp object types:            Techniques for XEmacs Developers.
2515 * critical redisplay sections:           Critical Redisplay Sections.
2516 * data dumping:                          Data dumping.
2517 * data types, character-related:         Character-Related Data Types.
2518 * DEC_CHARPTR:                           Working With Character and Byte Positions.
2519 * developers, techniques for XEmacs:     Techniques for XEmacs Developers.
2520 * devices; frames; windows, consoles;:   Consoles; Devices; Frames; Windows.
2521 * devices; frames; windows, introduction to consoles;: Introduction to Consoles; Devices; Frames; Windows.
2522 * Devin, Matthieu:                       Lucid Emacs.
2523 * dispatching events; the command builder: Dispatching Events; The Command Builder.
2524 * display order of extents:              Mathematics of Extent Ordering.
2525 * display-related Lisp objects, modules for other: Modules for other Display-Related Lisp Objects.
2526 * displayable Lisp objects, modules for the basic: Modules for the Basic Displayable Lisp Objects.
2527 * dumping:                               Dumping.
2528 * dumping address allocation:            Address allocation.
2529 * dumping and its justification, what is: Dumping.
2530 * dumping data descriptions:             Data descriptions.
2531 * dumping object inventory:              Object inventory.
2532 * dumping overview:                      Overview.
2533 * dumping phase:                         Dumping phase.
2534 * dumping, data:                         Data dumping.
2535 * dumping, file loading:                 Reloading phase.
2536 * dumping, object relocation:            Reloading phase.
2537 * dumping, pointers:                     Pointers dumping.
2538 * dumping, putting back the pdump_opaques: Reloading phase.
2539 * dumping, putting back the pdump_root_objects and pdump_weak_object_chains: Reloading phase.
2540 * dumping, putting back the pdump_root_struct_ptrs: Reloading phase.
2541 * dumping, reloading phase:              Reloading phase.
2542 * dumping, remaining issues:             Remaining issues.
2543 * dumping, reorganize the hash tables:   Reloading phase.
2544 * dumping, the header:                   The header.
2545 * dynamic array:                         Low-Level Modules.
2546 * dynamic binding; the specbinding stack; unwind-protects: Dynamic Binding; The specbinding Stack; Unwind-Protects.
2547 * dynamic scoping:                       The Lisp Language.
2548 * dynamic types:                         The Lisp Language.
2549 * editing operations, modules for standard: Modules for Standard Editing Operations.
2550 * Emacs 19, GNU:                         GNU Emacs 19.
2551 * Emacs 20, GNU:                         GNU Emacs 20.
2552 * Emacs, a history of:                   A History of Emacs.
2553 * Emchar:                                Character-Related Data Types.
2554 * Emchars, Bufbytes and:                 Bufbytes and Emchars.
2555 * encoding, internal character:          Internal Character Encoding.
2556 * encoding, internal string:             Internal String Encoding.
2557 * encodings, internal Mule:              Internal Mule Encodings.
2558 * encodings, Mule:                       Encodings.
2559 * encodings, Mule character sets and:    MULE Character Sets and Encodings.
2560 * Energize:                              Lucid Emacs.
2561 * Epoch <1>:                             XEmacs.
2562 * Epoch:                                 Lucid Emacs.
2563 * error checking:                        Techniques for XEmacs Developers.
2564 * EUC (Extended Unix Code), Japanese:    Japanese EUC (Extended Unix Code).
2565 * evaluation:                            Evaluation.
2566 * evaluation; stack frames; bindings:    Evaluation; Stack Frames; Bindings.
2567 * event gathering mechanism, specifics of the: Specifics of the Event Gathering Mechanism.
2568 * event loop functions, other:           Other Event Loop Functions.
2569 * event loop, events and the:            Events and the Event Loop.
2570 * event stream callback routines, the:   The Event Stream Callback Routines.
2571 * event, specifics about the Lisp object: Specifics About the Emacs Event.
2572 * events and the event loop:             Events and the Event Loop.
2573 * events, converting:                    Converting Events.
2574 * events, introduction to:               Introduction to Events.
2575 * events, main loop:                     Main Loop.
2576 * events; the command builder, dispatching: Dispatching Events; The Command Builder.
2577 * Extbyte:                               Character-Related Data Types.
2578 * Extcount:                              Character-Related Data Types.
2579 * Extended Unix Code, Japanese EUC:      Japanese EUC (Extended Unix Code).
2580 * extent fragments:                      Extent Fragments.
2581 * extent info, format of the:            Format of the Extent Info.
2582 * extent mathematics:                    Mathematics of Extent Ordering.
2583 * extent ordering <1>:                   Mathematics of Extent Ordering.
2584 * extent ordering:                       Extent Ordering.
2585 * extents:                               Extents.
2586 * extents, display order:                Mathematics of Extent Ordering.
2587 * extents, introduction to:              Introduction to Extents.
2588 * extents, markers and:                  Markers and Extents.
2589 * extents, zero-length:                  Zero-Length Extents.
2590 * external data, conversion to and from: Conversion to and from External Data.
2591 * external widget:                       Modules for Interfacing with X Windows.
2592 * faces:                                 Faces.
2593 * file system, modules for interfacing with the: Modules for Interfacing with the File System.
2594 * flusher:                               Lstream Methods.
2595 * fragments, extent:                     Extent Fragments.
2596 * frames; windows, consoles; devices;:   Consoles; Devices; Frames; Windows.
2597 * frames; windows, introduction to consoles; devices;: Introduction to Consoles; Devices; Frames; Windows.
2598 * Free Software Foundation:              A History of Emacs.
2599 * frob blocks, allocation from:          Allocation from Frob Blocks.
2600 * FSF:                                   A History of Emacs.
2601 * FSF Emacs <1>:                         GNU Emacs 20.
2602 * FSF Emacs:                             GNU Emacs 19.
2603 * function, compiled:                    Compiled Function.
2604 * garbage collection:                    Garbage Collection.
2605 * garbage collection - step by step:     Garbage Collection - Step by Step.
2606 * garbage collection protection <1>:     GCPROing.
2607 * garbage collection protection:         Writing Lisp Primitives.
2608 * garbage collection, conservative:      GCPROing.
2609 * garbage collection, invocation:        Invocation.
2610 * garbage_collect_1:                     garbage_collect_1.
2611 * gc_sweep:                              gc_sweep.
2612 * GCPROing:                              GCPROing.
2613 * global Lisp variables, adding:         Adding Global Lisp Variables.
2614 * glyph instantiation:                   Glyphs.
2615 * glyphs:                                Glyphs.
2616 * GNU Emacs 19:                          GNU Emacs 19.
2617 * GNU Emacs 20:                          GNU Emacs 20.
2618 * Gosling, James <1>:                    The Lisp Language.
2619 * Gosling, James:                        Through Version 18.
2620 * Great Usenet Renaming:                 Through Version 18.
2621 * Hackers (Steven Levy):                 A History of Emacs.
2622 * header files, inline functions:        Techniques for XEmacs Developers.
2623 * hierarchy of windows:                  Window Hierarchy.
2624 * history of Emacs, a:                   A History of Emacs.
2625 * Illinois, University of:               XEmacs.
2626 * INC_CHARPTR:                           Working With Character and Byte Positions.
2627 * inline functions:                      Techniques for XEmacs Developers.
2628 * inline functions, headers:             Techniques for XEmacs Developers.
2629 * inside, XEmacs from the:               XEmacs From the Inside.
2630 * instantiation, glyph:                  Glyphs.
2631 * integers and characters:               Integers and Characters.
2632 * interactive:                           Modules for Standard Editing Operations.
2633 * interfacing with the file system, modules for: Modules for Interfacing with the File System.
2634 * interfacing with the operating system, modules for: Modules for Interfacing with the Operating System.
2635 * interfacing with X Windows, modules for: Modules for Interfacing with X Windows.
2636 * internal character encoding:           Internal Character Encoding.
2637 * internal Mule encodings:               Internal Mule Encodings.
2638 * internal string encoding:              Internal String Encoding.
2639 * internationalization, modules for:     Modules for Internationalization.
2640 * interning:                             The XEmacs Object System (Abstractly Speaking).
2641 * interpreter and object system, modules for other aspects of the Lisp: Modules for Other Aspects of the Lisp Interpreter and Object System.
2642 * ITS (Incompatible Timesharing System): A History of Emacs.
2643 * Japanese EUC (Extended Unix Code):     Japanese EUC (Extended Unix Code).
2644 * Java:                                  The Lisp Language.
2645 * Java vs. Lisp:                         The Lisp Language.
2646 * JIS7:                                  JIS7.
2647 * Jones, Kyle:                           XEmacs.
2648 * Kaplan, Simon:                         XEmacs.
2649 * Levy, Steven:                          A History of Emacs.
2650 * library, Lucid Widget:                 Lucid Widget Library.
2651 * line start cache:                      Line Start Cache.
2652 * Lisp interpreter and object system, modules for other aspects of the: Modules for Other Aspects of the Lisp Interpreter and Object System.
2653 * Lisp language, the:                    The Lisp Language.
2654 * Lisp modules, basic:                   Basic Lisp Modules.
2655 * Lisp object types, creating:           Techniques for XEmacs Developers.
2656 * Lisp objects are represented in C, how: How Lisp Objects Are Represented in C.
2657 * Lisp objects, allocation of in XEmacs: Allocation of Objects in XEmacs Lisp.
2658 * Lisp objects, modules for other display-related: Modules for other Display-Related Lisp Objects.
2659 * Lisp objects, modules for the basic displayable: Modules for the Basic Displayable Lisp Objects.
2660 * Lisp primitives, writing:              Writing Lisp Primitives.
2661 * Lisp reader and compiler, the:         The Lisp Reader and Compiler.
2662 * Lisp vs. C:                            The Lisp Language.
2663 * Lisp vs. Java:                         The Lisp Language.
2664 * low-level allocation:                  Low-level allocation.
2665 * low-level modules:                     Low-Level Modules.
2666 * lrecords:                              lrecords.
2667 * lstream:                               Modules for Interfacing with the File System.
2668 * lstream functions:                     Lstream Functions.
2669 * lstream methods:                       Lstream Methods.
2670 * lstream types:                         Lstream Types.
2671 * lstream, creating an:                  Creating an Lstream.
2672 * Lstream_close:                         Lstream Functions.
2673 * Lstream_fgetc:                         Lstream Functions.
2674 * Lstream_flush:                         Lstream Functions.
2675 * Lstream_fputc:                         Lstream Functions.
2676 * Lstream_fungetc:                       Lstream Functions.
2677 * Lstream_getc:                          Lstream Functions.
2678 * Lstream_new:                           Lstream Functions.
2679 * Lstream_putc:                          Lstream Functions.
2680 * Lstream_read:                          Lstream Functions.
2681 * Lstream_reopen:                        Lstream Functions.
2682 * Lstream_rewind:                        Lstream Functions.
2683 * Lstream_set_buffering:                 Lstream Functions.
2684 * Lstream_ungetc:                        Lstream Functions.
2685 * Lstream_unread:                        Lstream Functions.
2686 * Lstream_write:                         Lstream Functions.
2687 * lstreams:                              Lstreams.
2688 * Lucid Emacs:                           Lucid Emacs.
2689 * Lucid Inc.:                            Lucid Emacs.
2690 * Lucid Widget Library:                  Lucid Widget Library.
2691 * macro hygiene:                         Techniques for XEmacs Developers.
2692 * main loop:                             Main Loop.
2693 * mark and sweep:                        Garbage Collection.
2694 * mark method <1>:                       lrecords.
2695 * mark method:                           Modules for Other Aspects of the Lisp Interpreter and Object System.
2696 * mark_object:                           mark_object.
2697 * marker <1>:                            Lstream Methods.
2698 * marker:                                Marker.
2699 * markers and extents:                   Markers and Extents.
2700 * mathematics of extent ordering:        Mathematics of Extent Ordering.
2701 * MAX_EMCHAR_LEN:                        Working With Character and Byte Positions.
2702 * menubars:                              Menubars.
2703 * menus:                                 Menus.
2704 * merging attempts:                      XEmacs.
2705 * MIT:                                   A History of Emacs.
2706 * Mlynarik, Richard:                     GNU Emacs 19.
2707 * modules for interfacing with the file system: Modules for Interfacing with the File System.
2708 * modules for interfacing with the operating system: Modules for Interfacing with the Operating System.
2709 * modules for interfacing with X Windows: Modules for Interfacing with X Windows.
2710 * modules for internationalization:      Modules for Internationalization.
2711 * modules for other aspects of the Lisp interpreter and object system: Modules for Other Aspects of the Lisp Interpreter and Object System.
2712 * modules for other display-related Lisp objects: Modules for other Display-Related Lisp Objects.
2713 * modules for regression testing:        Modules for Regression Testing.
2714 * modules for standard editing operations: Modules for Standard Editing Operations.
2715 * modules for the basic displayable Lisp objects: Modules for the Basic Displayable Lisp Objects.
2716 * modules for the redisplay mechanism:   Modules for the Redisplay Mechanism.
2717 * modules, a summary of the various XEmacs: A Summary of the Various XEmacs Modules.
2718 * modules, basic Lisp:                   Basic Lisp Modules.
2719 * modules, editor-level control flow:    Editor-Level Control Flow Modules.
2720 * modules, low-level:                    Low-Level Modules.
2721 * MS-Windows environment, widget-glyphs in the: Glyphs.
2722 * Mule character sets and encodings:     MULE Character Sets and Encodings.
2723 * Mule encodings:                        Encodings.
2724 * Mule encodings, internal:              Internal Mule Encodings.
2725 * MULE merged XEmacs appears:            XEmacs.
2726 * Mule, coding for:                      Coding for Mule.
2727 * Mule-aware code, an example of:        An Example of Mule-Aware Code.
2728 * Mule-aware code, general guidelines for writing: General Guidelines for Writing Mule-Aware Code.
2729 * NAS:                                   Modules for Interfacing with the Operating System.
2730 * native sound:                          Modules for Interfacing with the Operating System.
2731 * network connections:                   Modules for Interfacing with the Operating System.
2732 * network sound:                         Modules for Interfacing with the Operating System.
2733 * Niksic, Hrvoje:                        XEmacs.
2734 * obarrays:                              Obarrays.
2735 * object system (abstractly speaking), the XEmacs: The XEmacs Object System (Abstractly Speaking).
2736 * object system, modules for other aspects of the Lisp interpreter and: Modules for Other Aspects of the Lisp Interpreter and Object System.
2737 * object types, creating Lisp:           Techniques for XEmacs Developers.
2738 * object, the buffer:                    The Buffer Object.
2739 * object, the window:                    The Window Object.
2740 * objects are represented in C, how Lisp: How Lisp Objects Are Represented in C.
2741 * objects in XEmacs Lisp, allocation of: Allocation of Objects in XEmacs Lisp.
2742 * objects, modules for the basic displayable Lisp: Modules for the Basic Displayable Lisp Objects.
2743 * operating system, modules for interfacing with the: Modules for Interfacing with the Operating System.
2744 * outside, XEmacs from the:              XEmacs From the Outside.
2745 * pane:                                  Modules for the Basic Displayable Lisp Objects.
2746 * permanent objects:                     The XEmacs Object System (Abstractly Speaking).
2747 * pi, calculating:                       XEmacs From the Outside.
2748 * point:                                 Point.
2749 * pointers dumping:                      Pointers dumping.
2750 * positions, working with character and byte: Working With Character and Byte Positions.
2751 * primitives, writing Lisp:              Writing Lisp Primitives.
2752 * progress bars:                         Progress Bars.
2753 * protection, garbage collection:        GCPROing.
2754 * pseudo_closer:                         Lstream Methods.
2755 * Purify:                                Techniques for XEmacs Developers.
2756 * Quantify:                              Techniques for XEmacs Developers.
2757 * radio buttons, checkboxes and:         Checkboxes and Radio Buttons.
2758 * read syntax:                           The XEmacs Object System (Abstractly Speaking).
2759 * read-eval-print:                       XEmacs From the Outside.
2760 * reader:                                Lstream Methods.
2761 * reader and compiler, the Lisp:         The Lisp Reader and Compiler.
2762 * reader's guide:                        A Reader's Guide to XEmacs Coding Conventions.
2763 * redisplay mechanism, modules for the:  Modules for the Redisplay Mechanism.
2764 * redisplay mechanism, the:              The Redisplay Mechanism.
2765 * redisplay piece by piece:              Redisplay Piece by Piece.
2766 * redisplay sections, critical:          Critical Redisplay Sections.
2767 * regression testing, modules for:       Modules for Regression Testing.
2768 * reloading phase:                       Reloading phase.
2769 * relocating allocator:                  Low-Level Modules.
2770 * rename to XEmacs:                      XEmacs.
2771 * represented in C, how Lisp objects are: How Lisp Objects Are Represented in C.
2772 * rewinder:                              Lstream Methods.
2773 * RMS:                                   A History of Emacs.
2774 * scanner:                               Modules for Other Aspects of the Lisp Interpreter and Object System.
2775 * scoping, dynamic:                      The Lisp Language.
2776 * scrollbars:                            Scrollbars.
2777 * seekable_p:                            Lstream Methods.
2778 * selections:                            Modules for Interfacing with X Windows.
2779 * set_charptr_emchar:                    Working With Character and Byte Positions.
2780 * Sexton, Harlan:                        Lucid Emacs.
2781 * sound, native:                         Modules for Interfacing with the Operating System.
2782 * sound, network:                        Modules for Interfacing with the Operating System.
2783 * SPARCWorks:                            XEmacs.
2784 * specbinding stack; unwind-protects, dynamic binding; the: Dynamic Binding; The specbinding Stack; Unwind-Protects.
2785 * special forms, simple:                 Simple Special Forms.
2786 * specifiers:                            Specifiers.
2787 * stack frames; bindings, evaluation;:   Evaluation; Stack Frames; Bindings.
2788 * Stallman, Richard:                     A History of Emacs.
2789 * string:                                String.
2790 * string encoding, internal:             Internal String Encoding.
2791 * subprocesses:                          Subprocesses.
2792 * subprocesses, asynchronous:            Modules for Interfacing with the Operating System.
2793 * subprocesses, synchronous:             Modules for Interfacing with the Operating System.
2794 * Sun Microsystems:                      XEmacs.
2795 * sweep_bit_vectors_1:                   sweep_bit_vectors_1.
2796 * sweep_lcrecords_1:                     sweep_lcrecords_1.
2797 * sweep_strings:                         sweep_strings.
2798 * symbol:                                Symbol.
2799 * symbol values:                         Symbol Values.
2800 * symbols and variables:                 Symbols and Variables.
2801 * symbols, introduction to:              Introduction to Symbols.
2802 * synchronous subprocesses:              Modules for Interfacing with the Operating System.
2803 * tab controls:                          Tab Controls.
2804 * taxes, doing:                          XEmacs From the Outside.
2805 * techniques for XEmacs developers:      Techniques for XEmacs Developers.
2806 * TECO:                                  A History of Emacs.
2807 * temporary objects:                     The XEmacs Object System (Abstractly Speaking).
2808 * testing, regression:                   Regression Testing XEmacs.
2809 * text in a buffer, the:                 The Text in a Buffer.
2810 * textual representation, buffers and:   Buffers and Textual Representation.
2811 * Thompson, Chuck:                       XEmacs.
2812 * throw, catch and:                      Catch and Throw.
2813 * types, dynamic:                        The Lisp Language.
2814 * types, lstream:                        Lstream Types.
2815 * types, proper use of unsigned:         Proper Use of Unsigned Types.
2816 * University of Illinois:                XEmacs.
2817 * unsigned types, proper use of:         Proper Use of Unsigned Types.
2818 * unwind-protects, dynamic binding; the specbinding stack;: Dynamic Binding; The specbinding Stack; Unwind-Protects.
2819 * values, symbol:                        Symbol Values.
2820 * variables, adding global Lisp:         Adding Global Lisp Variables.
2821 * variables, symbols and:                Symbols and Variables.
2822 * vector:                                Vector.
2823 * vector, bit:                           Bit Vector.
2824 * version 18, through:                   Through Version 18.
2825 * version 19, GNU Emacs:                 GNU Emacs 19.
2826 * version 20, GNU Emacs:                 GNU Emacs 20.
2827 * widget interface, generic:             Generic Widget Interface.
2828 * widget library, Lucid:                 Lucid Widget Library.
2829 * widget-glyphs:                         Glyphs.
2830 * widget-glyphs in the MS-Windows environment: Glyphs.
2831 * widget-glyphs in the X environment:    Glyphs.
2832 * Win-Emacs:                             XEmacs.
2833 * window (in Emacs):                     Modules for the Basic Displayable Lisp Objects.
2834 * window hierarchy:                      Window Hierarchy.
2835 * window object, the:                    The Window Object.
2836 * window point internals:                The Window Object.
2837 * windows, consoles; devices; frames;:   Consoles; Devices; Frames; Windows.
2838 * windows, introduction to consoles; devices; frames;: Introduction to Consoles; Devices; Frames; Windows.
2839 * Wing, Ben:                             XEmacs.
2840 * writer:                                Lstream Methods.
2841 * writing good comments:                 Writing Good Comments.
2842 * writing Lisp primitives:               Writing Lisp Primitives.
2843 * writing Mule-aware code, general guidelines for: General Guidelines for Writing Mule-Aware Code.
2844 * writing new C code, rules when:        Rules When Writing New C Code.
2845 * X environment, widget-glyphs in the:   Glyphs.
2846 * X Window System, interface to the:     Interface to the X Window System.
2847 * X Windows, modules for interfacing with: Modules for Interfacing with X Windows.
2848 * XEmacs:                                XEmacs.
2849 * XEmacs from the inside:                XEmacs From the Inside.
2850 * XEmacs from the outside:               XEmacs From the Outside.
2851 * XEmacs from the perspective of building: XEmacs From the Perspective of Building.
2852 * XEmacs goes it alone:                  XEmacs.
2853 * XEmacs object system (abstractly speaking), the: The XEmacs Object System (Abstractly Speaking).
2854 * Zawinski, Jamie:                       Lucid Emacs.
2855 * zero-length extents:                   Zero-Length Extents.
2856
2857