Mercurial > hg > xemacs-beta
comparison man/internals/internals.texi @ 2182:c91543697b09
[xemacs-hg @ 2004-07-19 08:24:24 by stephent]
manual improvements <87n01w9zi9.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Mon, 19 Jul 2004 08:24:28 +0000 |
parents | 97a3d9ad40e2 |
children | e13775448cf0 |
comparison
equal
deleted
inserted
replaced
2181:5baae9bff30e | 2182:c91543697b09 |
---|---|
3671 @item | 3671 @item |
3672 Speed up redisplay. | 3672 Speed up redisplay. |
3673 @item | 3673 @item |
3674 Speed up syntax highlighting. It was suggested that ``maybe moving some | 3674 Speed up syntax highlighting. It was suggested that ``maybe moving some |
3675 of the syntax highlighting capabilities into C would make a | 3675 of the syntax highlighting capabilities into C would make a |
3676 difference.'' Wrong idea, I think. When processing one large file a | 3676 difference.'' Wrong idea, I think. When processing one 400kB file a |
3677 particular low-level routine was being called 40 @emph{million} times | 3677 particular low-level routine was being called 40 @emph{million} times |
3678 simply for @emph{one} call to @code{newline-and-indent}. Syntax | 3678 simply for @emph{one} call to @code{newline-and-indent}. Syntax |
3679 highlighting needs to be rewritten to use a reliable, fast parser, then | 3679 highlighting needs to be rewritten to use a reliable, fast parser, then |
3680 to trust the pre-parsed structure, and only do re-highlighting locally | 3680 to trust the pre-parsed structure, and only do re-highlighting locally |
3681 to a text change. Modern machines are fast enough to implement such | 3681 to a text change. Modern machines are fast enough to implement such |
3810 @item | 3810 @item |
3811 All @file{.c} files should @code{#include <config.h>} first. Almost all | 3811 All @file{.c} files should @code{#include <config.h>} first. Almost all |
3812 @file{.c} files should @code{#include "lisp.h"} second. | 3812 @file{.c} files should @code{#include "lisp.h"} second. |
3813 | 3813 |
3814 @item | 3814 @item |
3815 Generated header files should be included using the @code{#include <...>} syntax, | 3815 Generated header files should be included using the @samp{#include <...>} |
3816 not the @code{#include "..."} syntax. The generated headers are: | 3816 syntax, not the @samp{#include "..."} syntax. The generated headers are: |
3817 | 3817 |
3818 @file{config.h sheap-adjust.h paths.h Emacs.ad.h} | 3818 @file{config.h sheap-adjust.h paths.h Emacs.ad.h} |
3819 | 3819 |
3820 The basic rule is that you should assume builds using @code{--srcdir} | 3820 The basic rule is that you should assume builds using @samp{--srcdir} |
3821 and the @code{#include <...>} syntax needs to be used when the | 3821 and the @samp{#include <...>} syntax needs to be used when the |
3822 to-be-included generated file is in a potentially different directory | 3822 to-be-included generated file is in a potentially different directory |
3823 @emph{at compile time}. The non-obvious C rule is that @code{#include "..."} | 3823 @emph{at compile time}. The non-obvious C rule is that |
3824 means to search for the included file in the same directory as the | 3824 @samp{#include "..."} means to search for the included file in the same |
3825 including file, @emph{not} in the current directory. | 3825 directory as the including file, @emph{not} in the current directory. |
3826 | 3826 Normally this is not a problem but when building with @samp{--srcdir}, |
3827 @item | 3827 @file{make} will search the @samp{VPATH} for you, while the C compiler |
3828 Header files should @emph{not} include @code{<config.h>} and | 3828 knows nothing about it. |
3829 @code{"lisp.h"}. It is the responsibility of the @file{.c} files that | 3829 |
3830 @item | |
3831 Header files should @emph{not} include @samp{<config.h>} and | |
3832 @samp{"lisp.h"}. It is the responsibility of the @file{.c} files that | |
3830 use it to do so. | 3833 use it to do so. |
3831 | 3834 |
3832 @end itemize | 3835 @end itemize |
3833 | 3836 |
3834 @cindex Lisp object types, creating | 3837 @cindex Lisp object types, creating |
5337 the syntax scanner to recognize that this is a multi-character | 5340 the syntax scanner to recognize that this is a multi-character |
5338 delimiter. The @samp{newline} character is given (single-character) | 5341 delimiter. The @samp{newline} character is given (single-character) |
5339 ``comment-end'' @emph{class} and the ``style b first character of end | 5342 ``comment-end'' @emph{class} and the ``style b first character of end |
5340 sequence'' @emph{flag}. The ``comment-end'' class allows the scanner to | 5343 sequence'' @emph{flag}. The ``comment-end'' class allows the scanner to |
5341 determine that no second character is needed to terminate the comment. | 5344 determine that no second character is needed to terminate the comment. |
5345 | |
5346 There used to be a syntax class @samp{Sextword}. A character of | |
5347 @samp{Sextword} class is a word-constituent but a word boundary may | |
5348 exist between two such characters. Ken'ichi HANDA <handa@@etl.go.jp> | |
5349 explains the purpose of the Sextword syntax category: | |
5350 | |
5351 @quotation | |
5352 Japanese words are not separated by spaces, which makes finding word | |
5353 boundaries very difficult. Theoretically it's impossible without | |
5354 using natural language processing techniques. But, by defining | |
5355 pseudo-words as below (much simplified for letting you understand it | |
5356 easily) for Japanese, we can have a convenient forward-word function | |
5357 for Japanese. | |
5358 | |
5359 @display | |
5360 A Japanese word is a sequence of characters that consists of | |
5361 zero or more Kanji characters followed by zero or more | |
5362 Hiragana characters. | |
5363 @end display | |
5364 | |
5365 Then, the problem is that now we can't say that a sequence of | |
5366 word-constituents makes up a word. For instance, both Hiragana "A" | |
5367 and Kanji "KAN" are word-constituents but the sequence of these two | |
5368 letters can't be a single word. | |
5369 | |
5370 So, we introduced Sextword for Japanese letters. | |
5371 @end quotation | |
5372 | |
5373 There seems to have been some controversy about this category, as it has | |
5374 been removed, readded, and removed again. Currently neither GNU Emacs | |
5375 (21.3.99) nor XEmacs (21.5.17) seems to use it. | |
5342 | 5376 |
5343 | 5377 |
5344 @example | 5378 @example |
5345 casefiddle.c | 5379 casefiddle.c |
5346 @end example | 5380 @end example |
5817 mule-ccl.c | 5851 mule-ccl.c |
5818 mule-charset.c | 5852 mule-charset.c |
5819 mule-charset.h | 5853 mule-charset.h |
5820 file-coding.c | 5854 file-coding.c |
5821 file-coding.h | 5855 file-coding.h |
5856 mule-coding.c | |
5822 mule-mcpath.c | 5857 mule-mcpath.c |
5823 mule-mcpath.h | 5858 mule-mcpath.h |
5824 mule-wnnfns.c | 5859 mule-wnnfns.c |
5825 mule.c | 5860 mule.c |
5826 @end example | 5861 @end example |
5842 possibly from multiple character sets, using a stream of bytes or words, | 5877 possibly from multiple character sets, using a stream of bytes or words, |
5843 and defines (e.g.) which escape sequences are used to specify particular | 5878 and defines (e.g.) which escape sequences are used to specify particular |
5844 character sets, how the indices for a character are converted into bytes | 5879 character sets, how the indices for a character are converted into bytes |
5845 (sometimes this involves setting the high bit; sometimes complicated | 5880 (sometimes this involves setting the high bit; sometimes complicated |
5846 rearranging of the values takes place, as in the Shift-JIS encoding), | 5881 rearranging of the values takes place, as in the Shift-JIS encoding), |
5847 etc. | 5882 etc. It also contains some generic coding system implementations, such |
5883 as the binary (no-conversion) coding system and a sample gzip coding system. | |
5884 | |
5885 @file{mule-coding.c} contains the implementations of text coding systems. | |
5848 | 5886 |
5849 @file{mule-ccl.c} provides the CCL (Code Conversion Language) | 5887 @file{mule-ccl.c} provides the CCL (Code Conversion Language) |
5850 interpreter. CCL is similar in spirit to Lisp byte code and is used to | 5888 interpreter. CCL is similar in spirit to Lisp byte code and is used to |
5851 implement converters for custom encodings. | 5889 implement converters for custom encodings. |
5852 | 5890 |
5859 completely non-working. Instead, @code{pathname-coding-system} is used | 5897 completely non-working. Instead, @code{pathname-coding-system} is used |
5860 to specify conversions of names of files and directories. The standard | 5898 to specify conversions of names of files and directories. The standard |
5861 C I/O functions like @samp{open()} are wrapped so that conversion occurs | 5899 C I/O functions like @samp{open()} are wrapped so that conversion occurs |
5862 automatically. | 5900 automatically. |
5863 | 5901 |
5864 @file{mule.c} provides a few miscellaneous things that should probably | 5902 @file{mule.c} contains a few miscellaneous things. It currently seems |
5865 be elsewhere. | 5903 to be unused and probably should be removed. |
5866 | 5904 |
5867 | 5905 |
5868 | 5906 |
5869 @example | 5907 @example |
5870 intl.c | 5908 intl.c |
5905 md5-tests.el | 5943 md5-tests.el |
5906 mule-tests.el | 5944 mule-tests.el |
5907 regexp-tests.el | 5945 regexp-tests.el |
5908 symbol-tests.el | 5946 symbol-tests.el |
5909 syntax-tests.el | 5947 syntax-tests.el |
5948 tag-tests.el | |
5949 weak-tests.el | |
5910 @end example | 5950 @end example |
5911 | 5951 |
5912 @file{test-harness.el} defines the macros @code{Assert}, | 5952 @file{test-harness.el} defines the macros @code{Assert}, |
5913 @code{Check-Error}, @code{Check-Error-Message}, and | 5953 @code{Check-Error}, @code{Check-Error-Message}, and |
5914 @code{Check-Message}. The other files are test files, testing various | 5954 @code{Check-Message}. The other files are test files, testing various |
10579 In XEmacs, glyphs represent the uninstantiated state of graphical | 10619 In XEmacs, glyphs represent the uninstantiated state of graphical |
10580 elements, i.e. they hold all the information necessary to produce an | 10620 elements, i.e. they hold all the information necessary to produce an |
10581 image on-screen but the image need not exist at this stage, and multiple | 10621 image on-screen but the image need not exist at this stage, and multiple |
10582 screen images can be instantiated from a single glyph. | 10622 screen images can be instantiated from a single glyph. |
10583 | 10623 |
10624 @c #### find a place for this discussion | |
10625 @c The decision to make image specifiers a separate type is debatable. | |
10626 @c In fact, the design decision to create a separate image specifier | |
10627 @c type, rather than make glyphs themselves be specifiers, is | |
10628 @c debatable---the other properties of glyphs are rarely used and could | |
10629 @c conceivably have been incorporated into the glyph's instantiator. | |
10630 @c The rarely used glyph types (buffer, pointer, icon) could also have | |
10631 @c been incorporated into the instantiator. | |
10632 | |
10584 Glyphs are lazily instantiated by calling one of the glyph | 10633 Glyphs are lazily instantiated by calling one of the glyph |
10585 functions. This usually occurs within redisplay when | 10634 functions. This usually occurs within redisplay when |
10586 @code{Fglyph_height} is called. Instantiation causes an image-instance | 10635 @code{Fglyph_height} is called. Instantiation causes an image-instance |
10587 to be created and cached. This cache is on a per-device basis for all glyphs | 10636 to be created and cached. This cache is on a per-device basis for all glyphs |
10588 except widget-glyphs, and on a per-window basis for widgets-glyphs. The | 10637 except widget-glyphs, and on a per-window basis for widgets-glyphs. The |