annotate man/mule/mule.texi @ 112:48d667d6f17f r20-1b8

Import from CVS: tag r20-1b8
author cvs
date Mon, 13 Aug 2007 09:20:48 +0200
parents 360340f9fd5f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2 @node Coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 @section Coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 @noindent
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6 `coding-system' is a method for encoding several
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 character-sets and represented by a symbol which has
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 properties of 'coding-system and 'eol-type.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 You can specify different coding-system on file I/O, process
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 I/O, output to terminal (if not running on X), input from
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 keyboard (if not running on X).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 @menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 * Structure:: Structure of coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 o Property 'coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 o Property 'eol-type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 o Property 'post-read-conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 o Property 'pre-write-conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 * Creation:: How to create coding-system?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 * Predefined coding-system::
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 * Automatic conversion::
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 o Category of coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 o How automatic conversion works?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 o Priority of category
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 * Mode-line:: How coding-system is shown in mode-line?::
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 * ISO2022 restriction::
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 * Big5:: Special treatment of Big5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 @end menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 @node Structure
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 @subsection Structure of coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 @subsubsection Property 'coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 The value of the property 'coding-system is a vector:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 @quotation
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 [ TYPE MNEMONIC DOCUMENT DUMMY FLAGS ]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 @end quotation
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 or the other coding-system. Contents of the vector are:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 TYPE: nil: no conversion, t: automatic conversion,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 0:Internal, 1:Shift-JIS, 2:ISO2022, 3:Big5, 4:CCL.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 MNEMONIC: a character shown at mode-line to indicate the coding-system.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 DOCUMENT: a describing documents for the coding-system.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 DUMMY: always nil (for backward compatibility)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 FLAGS (option): more precise information about the coding-system,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 If TYPE is 2 (ISO2022), FLAGS should be a list of:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 LB-G0, LB-G1, LB-G2, LB-G3:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 Leading character of charset initially designated to G? graphic set,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 nil means G? is not designated initially,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 lb-invalid means G? can never be designated to,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 if (- leading-char) is specified, it is designated on output,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 SHORT: non-nil - allow such as \"ESC $ B\", nil - always \"ESC $ \( B\",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 ASCII-EOL: non-nil - designate ASCII to g0 at end of line on output,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 ASCII-CNTL: non-nil - designate ASCII to g0 at control codes on output
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 SEVEN: non-nil - use 7-bit environment on output,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 LOCK-SHIFT: non-nil - use locking-shift (SO/SI) instead of single-shift
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 or designation by escape sequence,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 USE-ROMAN: non-nil - designate JIS0201-1976-Roman instead of ASCII,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 USE-OLDJIS: non-nil - designate JIS0208-1976 instead of JIS0208-1983,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 NO-ISO6429: non-nil - don't use ISO6429's direction specification,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 If TYPE is 3 (Big5), FLAGS `t' means Big5-ETen, `nil' means Big5-HKU,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 If TYPE is 4 (private), FLAGS should be a cons of CCL programs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 for encoding and decoding. See documentation of CCL for more detail.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 @subsubsection Property 'eol-type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 The value of the property 'eol-type is:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 nil: no conversion for end-of-line type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 1: LF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 2: CRLF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 3: CR
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 vector of length 3: automatic detection of end-of-line type.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 1st element: coding-system of eol-type LF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 2nd element: coding-system of eol-type CRLF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 3rd element: coding-system of eol-type CR
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 @subsubsection Property 'post-read-conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 The value of the property 'post-read-conversion is a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 function to convert some text just read into a buffer. When
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 the function is called, the text has already been converted
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 according to 'coding-system and 'eol-type of the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 coding-system. The argument of the function is the region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 (START and END) of inserted text.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 @subsection Property 'pre-write-conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 The value of the property 'pre-write-conversion is a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 function to convert some text just before writing it out.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 After the function is called, the text is converted accoding
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 to 'coding-system and 'eol-type of the coding-system. The
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 argument of the function is the region (START and END) of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 the text.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99 @node Creation
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 @subsection How to create coding-system?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 Mule provides a function `make-coding-system' to create a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 coding-system.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 FUNCTION make-coding-system: NAME TYPE MNEMONIC DOC &optional EOL-TYPE FLAGS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 Register symbol NAME as a coding-system whose 'coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 property is a vector [ TYPE MNEMONIC DOC nil FLAGS ] and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 'eol-type property is EOL-TYPE. If `t' is specified as
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 EOL-TYPE, the value of 'eol-type property is a vector of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 generated coding-systems whose 'eol-type properties are 1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 (LF), 2 (CRLF), and 3 (CR). The names of generated
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 coding-systems are NAMEunix, NAMEdos, and NAMEmac respectively.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
115 Just to make an alias of some coding-system, call a function
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 `copy-coding-system'.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 FUNCTION copy-coding-system: ORIGINAL ALIAS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 Make the same coding-system as ORIGINAL and name it ALIAS.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 If 'eol-type property of ORIGINAL is a vector, coding-systems
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 ALIASunix, ALIASdos, and ALIASmac are generated, and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 'eol-type property of ALIAS becomes a vector of them.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 @node Predefined coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126 @subsection Predefined coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 See lisp/mule.el.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 @node Automatic conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 @subsection Automatic conversion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 @subsubsection Category of coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 Mule has a facility to detect coding-system of text
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 automatically, however, what mule actually detect is not a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 coding-system itself but a category of coding-system. A
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 category is also represented by a symbol and a value should
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 be an actual coding-system.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 There are eight categories:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 @table @asis
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 @item *coding-category-internal*:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 coding-system used in a buffer
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 @item *coding-category-sjis*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 Shift-JIS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 @item *coding-category-iso-7*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 ISO2022 variation with the following feature:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 o no locking shift, single shift
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 o only G0 is used
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 @item *coding-category-iso-8-1*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 ISO2022 variation with the following feature:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 o no locking shift
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 o designation sequence is allowed only for G0 and G1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 o G1 is used only for 1-byte character set
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 @item *coding-category-iso-8-2*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 ISO2022 variation with the following feature:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 o no locking shift
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 o designation sequence is allowed only for G0 and G1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 o G1 is used only for 2-byte character set
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161 @item *coding-category-iso-else*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 ISO2022 variation which doesn't satisfy any of above.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 @item *coding-category-big5*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 Big5 (ETen or HKU)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 @item *coding-category-bin*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 Any other coding-system which uses MSB.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 @end table
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 The values of these symbols are pre-defined as follows:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 ----- lisp/mule.el -----------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 (defvar *coding-category-internal* '*internal*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 (defvar *coding-category-sjis* '*sjis*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 (defvar *coding-category-iso-7* '*junet*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (defvar *coding-category-iso-8-1* '*ctext*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 (defvar *coding-category-iso-8-2* '*euc-japan*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 (defvar *coding-category-iso-else* '*iso-2022-ss2-7*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 (defvar *coding-category-big5* '*big5-eten*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 (defvar *coding-category-bin* '*noconv*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181 ------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 but, some of them are overridden in such language specific
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 files as japanese.el, chinese.el, etc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 @subsubsection How automatic conversion works?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 When coding-system `*autoconv*' is specified on reading text
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 (this is the default), mule tries to detect a category of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 coding-system by which text are encoded. If an appropriate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 category is found, it converts text according to a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 coding-system bound to the cateogry. If the 'eol-type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 property of the coding-system is a vector of coding-systems
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 and Mule detects a type of end-of-line (LF, CRLF, or CR) of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 the text, one of those coding-system is used.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 Automatic conversion occurs both on reading from files and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 inputing from process. In the latter case, if some
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 coding-system is found, output-coding-system of the process
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 is also set to the found coding-system.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 @subsubsection Priority of cateogry
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 In the case that more than two categories are found, the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 category of the highest priority is selected.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 A priority of category is pre-defined as follows:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 ----- lisp/mule.el -----------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 (set-coding-priority
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 '(*coding-category-iso-8-2*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 *coding-category-sjis*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 *coding-category-iso-8-1*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 *coding-category-big5*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 *coding-category-iso-7*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 *coding-category-iso-else*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 *coding-category-bin*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 *coding-category-internal*))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 ------------------------------------------------------------
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 The function `set-coding-priority' put a property 'priority
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 to each element of the argument from 0 to 7 (smaller number
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 has higher priority). Some language specific files may
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227 override this priority.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 @node Mode-line
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 @subsection How coding-system is shown in mode-line?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
231
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
232 Each coding-system has unique mnemonic (one character).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 By default, mnemonic of `file-coding-system' of a buffer is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 shown at the left of mode-line of the buffer. In addition,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235 the mnemonic is followed by an another mnemonic to show
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
236 eol-type of the coding-system. This mnemonic is defined as
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 follows:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 ".": LF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
239 ":": CRLF
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 "'": CR
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 "_": not yet desided
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 "-": nil (for coding-system of nil, *noconv*, or *internal*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 So, usual appearance of mode-line for a buffer which is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 visiting a file (*junet* encoding on Unix system) is:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
247 +-- mnemonic of file-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 |+-- mnemonic of eol-type
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 VV
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 [--]J.:----Mule: filename
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 The left most bracket is the indicator for inputing method.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 When a buffer is attaced to some process, coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256 for input and output of the process are also shown as
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 follows:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
258
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260 +-- mnemonic of file-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
261 |+-- mnemonic of eol-type of file-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
262 ||+-- mnemonic of input-coding-system of a process
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263 |||+-- mnemonic of eol-type of input-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264 ||||+-- mnemonic of output-coding-system of a process
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265 |||||+-- mnemonic of eol-type of output-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 VVVVVV
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 [--]+_+.--:--**-Mule: *shell*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270 This means that Mule is now communicating with shell with
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271 coding-systems *autoconv*unix ("+.") for input and nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272 ("--") for output.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
273
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274 @node ISO2022 restriction
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
275 @subsection ISO2022 restriction
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277 For decoding to Type 2 (ISO2022), we have the following
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 restrictions:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280 @table @asis
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 @item Locking-Shift:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 Use SI and SO only when decoding with a coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 whose LOCK-SHIFT and SEVEN is t.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 @item Single-Shift:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 Use SS2 and SS3 (if SEVEN is nil) or ESC N and ESC O (if
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287 SEVEN is t).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
288
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
289 @item Invocation:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
290 G0 is always invoked to GL, G1 to GR (but only if SEVEN is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
291 nil). G2 and G3 are invoked to GL by Single-Shift of SS2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
292 and SS3.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
293
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 @item Unofficial use of ESC sequence for designation:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
295 If SEVEN is t, LOCK-SHIFT is nil, and designation to G2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296 and G3 are prohibited, we should designate all character
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 sets to G0 (and hence invoke to GL). To designate 96
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 char-set to G0, we use "ESC , <F>". For instance, to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
299 designate ISO8859-1 to G0, we use "ESC , A".
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
300
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 @item Unofficial use of ESC sequence for composit character:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 To indicate the start and end of composit character, we
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 use ESC 0 (start) and ESC 1 (end).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 @item Text direction specifier of ISO6429
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 We use ISO6429's ESC sequence "ESC [ 2 ]" to change text
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 direction to right-to-left, and "ESC [ 0 ]" to revert it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308 to left-to-right.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 @end table
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 @node Big5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 @subsection Special treatment of Big5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 As far as I know, there's several different codes called
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 Big5. The most famous ones are Big5-ETen and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 Big5-HKU-form2. Since both of them use a code range 0xa140
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 - 0xfefe (in each row, columns (second byte) 0x7f - 0xa0 is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 skipped) and number of characters is more than 13000, it's
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319 impossible to treat each of them as a single character-set
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 in the current Mule system. So, Mule treat them in a quite
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321 irregular manner as described below:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 Mule does not treats them as a different character set,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 but as the same character set called Big5.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327 Caution!! Big5 is a different character set from GB.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 Mule divides Big5 into two sub-character-sets:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 0xa140 - 0xc67e (Level 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 0xc6a1 - 0xfefe (Level 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 and allocates two leading-chars lc-big5-1 and lc-big5-2 to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 them. (See character.txt)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 Usually, each leading-char (or character-set) has unique
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 character category. But lc-big5-1 and lc-big5-2 has the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 same character category of mnemonic 't'. So, regular
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 expression "\\ct" matches any Big5 (Level 1 and Level 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 characters. (See syntax.txt)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 If you specify ISO2022 type coding-system on output,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 Mule converts Big5 code using unofficial final-characters
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 '0' (for Level 1) and '1' (for Level 2).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 You can use either fonts of ETen or HKU for displaying
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 Big5 code. Mule judges which font is used by examining
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 existence of character whose code point is 0xC6A1. If it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352 exists, the font is HKU, else the fonts is ETen.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 @node Syntax
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 @section Syntax and Category of character
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 @subsection Syntax
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 Mule can define syntax of all multi-byte characters by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 @code{modify-syntax-entry}.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 The first argument of @code{modify-syntax-entry should} be one of below:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 ASCII character
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 multi-byte character
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 leading character of multi-byte character
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 partially defined characters returned by:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 @quotation
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 @code{(make-character leading-char arg)}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 @end quotation
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 There's a restriction of specifying matching character within
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 second argument. If the first argument specifies multi-byte
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381 character or leading char of multi-byte character, the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 matching character should have the same leading character. If
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 the character is 2-byte code, the first-byte of it should
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 also be the same with the first-byte of first argument.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386 @subsection Category
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 Like syntax, category also defines characteristics of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 characters. The differences are:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 Each Character can have more than one category.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 User can define new type of category as he wishes.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 Example: See japanese.el
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 @code{char-category} returns all mnemonics of the character by string.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 For regular expression search, you can use the \cm or \Cm (any mnemonics
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 comes at the place of 'm') instead of \sm and \Sm.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 @node Font
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 @section Font
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 FONTSET is a set of fonts which have the same height and style. A
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 fontset should hopefully contain enough fonts to display a character of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 various character sets.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 Mule uses fontset instead of font. You can specify fontset at any place
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 where you can specify font. You can still specify font, in which case,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 a fontset which include the font is searched and used.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 Like font, fontset is also a string specifying the name.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 @menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 * Initial fontsets:: Fontsets which Mule have at startup time.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 * Specify fontset:: How to specify a fontset?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 * Manage fontset:: How to create or modify a fontset?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 @end menu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 @node Initial fontsets
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 @subsection Initial fontsets
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 @subsubsection "default-fontset"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 Mule automatically creates a fontset named "default-fontset" at startup
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 time. Each font in this fontset is specifed by a very generic name such
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 as "-*-fixed-medium-r-*--16-*-iso8859-1" for ASCII and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 "-*-fixed-medium-r-*--*-jisx0208.1983-*" for JISX0208 (Kanji).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 These values are defined in @file{lisp/term/x-win.el}.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 If there's no other fontsets specifed by X's resource, "default-fontset"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 is used for the first frame of Mule.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 In most cases, this is enough. You probably don't have to have any
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 other fontsets.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 @subsubsection X's resourse
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 Mule also creates fontsets specified in X's resource "fontSetList (class
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 FontSetList)". The value is a comma separated list of fontset names.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 *FontSetList: 16,24
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 The actual contents of each fontset is specified by "fontSet-xxx (class
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 FontSet-xxx)" where "xxx" is a name of the corresponding fontset. The
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 value of this resource is a comma separated list of font names.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453 *FontSet-16: -etl-fixed-medium-r-*--24-*-iso8859-1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 Each font name should not contain wild card `*' or `?' in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 CHARSET_REGSTRY field because a character set for this font is
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 recognized by this field. This means that you don't have to care about
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 the order of font names.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 For instance,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 *FontSet-16:\
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 -etl-fixed-medium-r-*--16-*-iso8859-1\
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 -ming-fixed-medium-r-*--*-*-jisx0208.1983-*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 is enough to tell Mule that the fontset "16" contains ASCII font and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 JISX0208 font. Please note that the second name has only wild card in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 PIXEL_SIZE field. Since Mule try to open a font of the same PIXEL_SIZE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 as ASCII font of the same fontset, you'ld better not specify actual
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 value in PIXEL_SIZE field except for ASCII font.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 As for fonts not listed in the specification of fontset, corresponding
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 font names in "default fontset" is used.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478 The first fontset in FontSetList is used for the first frame of Mule.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 If you want to use "default-fontset" while specifying other fontsets in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 the resource, please put "default-fontset" at the first of the value.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
482 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 *FontSetList: default-fontset,16,24
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 In this case, you don't have to have the resource
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 "FontSet-default-fontset".
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 @node Specify fontset
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490 @subsection How to specify a fontset?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 You can specify fontset at any place where you can sepcify font.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 To change the fontset used for the first frame of Mule:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 command line arguments "-fn xxx" or "-font xxx"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 If this argument exits, fontset is searched in the following order:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 A fontset whose name is "xxx".
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505 A fontset which contains ASCII font "xxx".
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507 Create a new fontset "xxx" which contains ASCII font "xxx".
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 In your ~/.emacs,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 (setcdr (assoc 'font default-frame-alist) "xxx")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 To change a fontset after Mule started:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521 @enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
522 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523 By the command
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
524
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
525 @example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526 M-x set-default-fontset<CR>xxx<CR>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
527 @end example
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
530 By @key{Ctl-Mouse-3}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 @end enumerate
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534 @node Manage fontset
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
535 @subsection How to create or modify a fontset?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
536
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
537 You can create a new fontset by `new-fontset' and modify an
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 existing fontset by `set-fontset-font'.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
540 You can get a list of fontset currently created by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
541 `fonset-list'.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
543 You can check if a fontset is already created or not by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
544 `fonsetp'.