comparison man/lispref/display.texi @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 501cfd01ee6d
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
872 872
873 @item 873 @item
874 All other codes in the range 0 through 31, and code 127, display in one 874 All other codes in the range 0 through 31, and code 127, display in one
875 of two ways according to the value of @code{ctl-arrow}. If it is 875 of two ways according to the value of @code{ctl-arrow}. If it is
876 non-@code{nil}, these codes map to sequences of two glyphs, where the 876 non-@code{nil}, these codes map to sequences of two glyphs, where the
877 first glyph is the @sc{ascii} code for @samp{^}. (A display table can 877 first glyph is the @sc{ASCII} code for @samp{^}. (A display table can
878 specify a glyph to use instead of @samp{^}.) Otherwise, these codes map 878 specify a glyph to use instead of @samp{^}.) Otherwise, these codes map
879 just like the codes in the range 128 to 255. 879 just like the codes in the range 128 to 255.
880 880
881 @item 881 @item
882 Character codes 128 through 255 map to sequences of four glyphs, where 882 Character codes 128 through 255 map to sequences of four glyphs, where
883 the first glyph is the @sc{ascii} code for @samp{\}, and the others are 883 the first glyph is the @sc{ASCII} code for @samp{\}, and the others are
884 digit characters representing the code in octal. (A display table can 884 digit characters representing the code in octal. (A display table can
885 specify a glyph to use instead of @samp{\}.) 885 specify a glyph to use instead of @samp{\}.)
886 @end itemize 886 @end itemize
887 887
888 The usual display conventions apply even when there is a display 888 The usual display conventions apply even when there is a display
919 @section Display Tables 919 @section Display Tables
920 920
921 @cindex display table 921 @cindex display table
922 You can use the @dfn{display table} feature to control how all 256 922 You can use the @dfn{display table} feature to control how all 256
923 possible character codes display on the screen. This is useful for 923 possible character codes display on the screen. This is useful for
924 displaying European languages that have letters not in the @sc{ascii} 924 displaying European languages that have letters not in the @sc{ASCII}
925 character set. 925 character set.
926 926
927 The display table maps each character code into a sequence of 927 The display table maps each character code into a sequence of
928 @dfn{runes}, each rune being an image that takes up one character 928 @dfn{runes}, each rune being an image that takes up one character
929 position on the screen. You can also define how to display each rune 929 position on the screen. You can also define how to display each rune
994 the same thing. FSF Emacs also uses a different format for 994 the same thing. FSF Emacs also uses a different format for
995 the contents of a display table, using additional indirection 995 the contents of a display table, using additional indirection
996 to a ``glyph table'' and such. Note that ``glyph'' has a different 996 to a ``glyph table'' and such. Note that ``glyph'' has a different
997 meaning in XEmacs.) 997 meaning in XEmacs.)
998 998
999 @defvar current-display-table
1000
1001 The display table currently in use. This is a specifier.
1002
1003 Display tables are used to control how characters are displayed. Each
1004 time that redisplay processes a character, it is looked up in all the
1005 display tables that apply (obtained by calling @code{specifier-instance}
1006 on @code{current-display-table} and any overriding display tables
1007 specified in currently active faces). The first entry found that
1008 matches the character determines how the character is displayed. If
1009 there is no matching entry, the default display method is
1010 used. (Non-control characters are displayed as themselves and control
1011 characters are displayed according to the buffer-local variable
1012 @code{ctl-arrow}. Control characters are further affected by
1013 @code{control-arrow-glyph} and @code{octal-escape-glyph}.)
1014
1015 Each instantiator in this specifier and the display-table specifiers
1016 in faces is a display table or a list of such tables. If a list, each
1017 table will be searched in turn for an entry matching a particular
1018 character. Each display table is one of
1019
1020 @itemize @bullet
1021 @item
1022 A vector, specifying values for characters starting at 0.
1023 @item
1024 A char table, either of type @code{char} or @code{generic}.
1025 @item
1026 A range table.
1027 @end itemize
1028
1029 Each entry in a display table should be one of
1030
1031 @itemize @bullet
1032 @item
1033 nil (this entry is ignored and the search continues).
1034 @item
1035 A character (use this character; if it happens to be the same as
1036 the original character, default processing happens, otherwise
1037 redisplay attempts to display this character directly;
1038 #### At some point recursive display-table lookup will be
1039 implemented).
1040 @item
1041 A string (display each character in the string directly;
1042 #### At some point recursive display-table lookup will be
1043 implemented).
1044 @item
1045 A glyph (display the glyph;
1046 #### At some point recursive display-table lookup will be
1047 implemented when a string glyph is being processed).
1048 @item
1049 A cons of the form (format "@var{string}") where @var{string} is a
1050 printf-like spec used to process the character. #### Unfortunately no
1051 formatting directives other than %% are implemented.
1052 @item
1053 A vector (each element of the vector is processed recursively;
1054 in such a case, nil elements in the vector are simply ignored).
1055
1056 #### At some point in the near future, display tables are likely to
1057 be expanded to include other features, such as referencing characters
1058 in particular fonts and allowing the character search to continue
1059 all the way up the chain of specifier instantiators. These features
1060 are necessary to properly display Unicode characters.
1061 @end itemize
1062 @end defvar
1063
1064 Individual faces can also specify an overriding display table; 999 Individual faces can also specify an overriding display table;
1065 this is set using @code{set-face-display-table}. @xref{Faces}. 1000 this is set using @code{set-face-display-table}. @xref{Faces}.
1066 1001
1067 If no display table can be determined for a particular window, 1002 If no display table can be determined for a particular window,
1068 then XEmacs uses the usual display conventions. @xref{Usual Display}. 1003 then XEmacs uses the usual display conventions. @xref{Usual Display}.
1103 ;; @r{(Codes 128--159 are the additional control characters.)} 1038 ;; @r{(Codes 128--159 are the additional control characters.)}
1104 (standard-display-8bit 160 255) 1039 (standard-display-8bit 160 255)
1105 @end example 1040 @end example
1106 1041
1107 If you are editing buffers written in the ISO Latin 1 character set and 1042 If you are editing buffers written in the ISO Latin 1 character set and
1108 your terminal doesn't handle anything but @sc{ascii}, you can load the 1043 your terminal doesn't handle anything but @sc{ASCII}, you can load the
1109 file @file{iso-ascii} to set up a display table that displays the other 1044 file @file{iso-ascii} to set up a display table that displays the other
1110 ISO characters as explanatory sequences of @sc{ascii} characters. For 1045 ISO characters as explanatory sequences of @sc{ASCII} characters. For
1111 example, the character ``o with umlaut'' displays as @samp{@{"o@}}. 1046 example, the character ``o with umlaut'' displays as @samp{@{"o@}}.
1112 1047
1113 Some European countries have terminals that don't support ISO Latin 1 1048 Some European countries have terminals that don't support ISO Latin 1
1114 but do support the special characters for that country's language. You 1049 but do support the special characters for that country's language. You
1115 can define a display table to work one language using such terminals. 1050 can define a display table to work one language using such terminals.