428
|
1 @c This is part of the Emacs manual.
|
|
2 @c Copyright (C) 1997 Free Software Foundation, Inc.
|
|
3 @c See file emacs.texi for copying conditions.
|
|
4 @node Mule, Major Modes, Windows, Top
|
|
5 @chapter World Scripts Support
|
|
6 @cindex MULE
|
|
7 @cindex international scripts
|
|
8 @cindex multibyte characters
|
|
9 @cindex encoding of characters
|
|
10
|
|
11 @cindex Chinese
|
|
12 @cindex Greek
|
|
13 @cindex IPA
|
|
14 @cindex Japanese
|
|
15 @cindex Korean
|
600
|
16 @cindex Cyrillic
|
428
|
17 @cindex Russian
|
600
|
18 If you build XEmacs using the @code{--with-mule} option, it supports a
|
|
19 wide variety of world scripts, including the Latin script, the Arabic
|
|
20 script, Simplified Chinese (for mainland of China), Traditional Chinese
|
|
21 (for Taiwan and Hong-Kong), the Greek script, the Hebrew script, IPA
|
428
|
22 symbols, Japanese scripts (Hiragana, Katakana and Kanji), Korean scripts
|
600
|
23 (Hangul and Hanja) and the Cyrillic script (for Byelorussian, Bulgarian,
|
428
|
24 Russian, Serbian and Ukrainian). These features have been merged from
|
|
25 the modified version of Emacs known as MULE (for ``MULti-lingual
|
|
26 Enhancement to GNU Emacs'').
|
|
27
|
|
28 @menu
|
|
29 * Mule Intro:: Basic concepts of Mule.
|
|
30 * Language Environments:: Setting things up for the language you use.
|
|
31 * Input Methods:: Entering text characters not on your keyboard.
|
|
32 * Select Input Method:: Specifying your choice of input methods.
|
|
33 * Coding Systems:: Character set conversion when you read and
|
|
34 write files, and so on.
|
|
35 * Recognize Coding:: How XEmacs figures out which conversion to use.
|
|
36 * Specify Coding:: Various ways to choose which conversion to use.
|
|
37 @end menu
|
|
38
|
|
39 @node Mule Intro, Language Environments, Mule, Mule
|
|
40 @section Introduction to world scripts
|
|
41
|
|
42 The users of these scripts have established many more-or-less standard
|
|
43 coding systems for storing files.
|
|
44 @c XEmacs internally uses a single multibyte character encoding, so that it
|
|
45 @c can intermix characters from all these scripts in a single buffer or
|
|
46 @c string. This encoding represents each non-ASCII character as a sequence
|
|
47 @c of bytes in the range 0200 through 0377.
|
|
48 XEmacs translates between the internal character encoding and various
|
|
49 other coding systems when reading and writing files, when exchanging
|
|
50 data with subprocesses, and (in some cases) in the @kbd{C-q} command
|
|
51 (see below).
|
|
52
|
|
53 @kindex C-h h
|
|
54 @findex view-hello-file
|
|
55 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
|
|
56 @file{etc/HELLO}, which shows how to say ``hello'' in many languages.
|
|
57 This illustrates various scripts.
|
|
58
|
|
59 Keyboards, even in the countries where these character sets are used,
|
|
60 generally don't have keys for all the characters in them. So XEmacs
|
|
61 supports various @dfn{input methods}, typically one for each script or
|
|
62 language, to make it convenient to type them.
|
|
63
|
|
64 @kindex C-x RET
|
|
65 The prefix key @kbd{C-x @key{RET}} is used for commands that pertain
|
|
66 to world scripts, coding systems, and input methods.
|
|
67
|
|
68
|
|
69 @node Language Environments, Input Methods, Mule Intro, Mule
|
|
70 @section Language Environments
|
|
71 @cindex language environments
|
|
72
|
|
73 All supported character sets are supported in XEmacs buffers if it is
|
|
74 compile with mule; there is no need to select a particular language in
|
|
75 order to display its characters in an XEmacs buffer. However, it is
|
|
76 important to select a @dfn{language environment} in order to set various
|
|
77 defaults. The language environment really represents a choice of
|
|
78 preferred script (more or less) rather that a choice of language.
|
|
79
|
|
80 The language environment controls which coding systems to recognize
|
|
81 when reading text (@pxref{Recognize Coding}). This applies to files,
|
|
82 incoming mail, netnews, and any other text you read into XEmacs. It may
|
|
83 also specify the default coding system to use when you create a file.
|
|
84 Each language environment also specifies a default input method.
|
|
85
|
|
86 @findex set-language-environment
|
|
87 The command to select a language environment is @kbd{M-x
|
|
88 set-language-environment}. It makes no difference which buffer is
|
|
89 current when you use this command, because the effects apply globally to
|
|
90 the XEmacs session. The supported language environments include:
|
|
91
|
|
92 @quotation
|
600
|
93 ASCII, Chinese-BIG5, Chinese-GB, Croatian, Cyrillic-ALT, Cyrillic-ISO,
|
|
94 Cyrillic-KOI8, Cyrillic-Win, Czech, English, Ethiopic, French, German,
|
|
95 Greek, Hebrew, IPA, Japanese, Korean, Latin-1, Latin-2, Latin-3, Latin-4,
|
|
96 Latin-5, Norwegian, Polish, Romanian, Slovenian, Thai-XTIS, Vietnamese.
|
428
|
97 @end quotation
|
|
98
|
|
99 Some operating systems let you specify the language you are using by
|
|
100 setting locale environment variables. XEmacs handles one common special
|
|
101 case of this: if your locale name for character types contains the
|
|
102 string @samp{8859-@var{n}}, XEmacs automatically selects the
|
|
103 corresponding language environment.
|
|
104
|
|
105 @kindex C-h L
|
|
106 @findex describe-language-environment
|
|
107 To display information about the effects of a certain language
|
|
108 environment @var{lang-env}, use the command @kbd{C-h L @var{lang-env}
|
|
109 @key{RET}} (@code{describe-language-environment}). This tells you which
|
|
110 languages this language environment is useful for, and lists the
|
|
111 character sets, coding systems, and input methods that go with it. It
|
|
112 also shows some sample text to illustrate scripts used in this language
|
|
113 environment. By default, this command describes the chosen language
|
|
114 environment.
|
|
115
|
|
116 @node Input Methods, Select Input Method, Language Environments, Mule
|
|
117 @section Input Methods
|
|
118
|
|
119 @cindex input methods
|
|
120 An @dfn{input method} is a kind of character conversion designed
|
|
121 specifically for interactive input. In XEmacs, typically each language
|
|
122 has its own input method; sometimes several languages which use the same
|
|
123 characters can share one input method. A few languages support several
|
|
124 input methods.
|
|
125
|
|
126 The simplest kind of input method works by mapping ASCII letters into
|
|
127 another alphabet. This is how the Greek and Russian input methods work.
|
|
128
|
|
129 A more powerful technique is composition: converting sequences of
|
|
130 characters into one letter. Many European input methods use composition
|
|
131 to produce a single non-ASCII letter from a sequence that consists of a
|
|
132 letter followed by accent characters. For example, some methods convert
|
|
133 the sequence @kbd{'a} into a single accented letter.
|
|
134
|
|
135 The input methods for syllabic scripts typically use mapping followed
|
|
136 by composition. The input methods for Thai and Korean work this way.
|
|
137 First, letters are mapped into symbols for particular sounds or tone
|
|
138 marks; then, sequences of these which make up a whole syllable are
|
|
139 mapped into one syllable sign.
|
|
140
|
|
141 Chinese and Japanese require more complex methods. In Chinese input
|
|
142 methods, first you enter the phonetic spelling of a Chinese word (in
|
|
143 input method @code{chinese-py}, among others), or a sequence of portions
|
|
144 of the character (input methods @code{chinese-4corner} and
|
|
145 @code{chinese-sw}, and others). Since one phonetic spelling typically
|
|
146 corresponds to many different Chinese characters, you must select one of
|
|
147 the alternatives using special XEmacs commands. Keys such as @kbd{C-f},
|
|
148 @kbd{C-b}, @kbd{C-n}, @kbd{C-p}, and digits have special definitions in
|
|
149 this situation, used for selecting among the alternatives. @key{TAB}
|
|
150 displays a buffer showing all the possibilities.
|
|
151
|
|
152 In Japanese input methods, first you input a whole word using
|
|
153 phonetic spelling; then, after the word is in the buffer, XEmacs
|
|
154 converts it into one or more characters using a large dictionary. One
|
|
155 phonetic spelling corresponds to many differently written Japanese
|
|
156 words, so you must select one of them; use @kbd{C-n} and @kbd{C-p} to
|
|
157 cycle through the alternatives.
|
|
158
|
|
159 Sometimes it is useful to cut off input method processing so that the
|
|
160 characters you have just entered will not combine with subsequent
|
|
161 characters. For example, in input method @code{latin-1-postfix}, the
|
|
162 sequence @kbd{e '} combines to form an @samp{e} with an accent. What if
|
|
163 you want to enter them as separate characters?
|
|
164
|
|
165 One way is to type the accent twice; that is a special feature for
|
|
166 entering the separate letter and accent. For example, @kbd{e ' '} gives
|
|
167 you the two characters @samp{e'}. Another way is to type another letter
|
|
168 after the @kbd{e}---something that won't combine with that---and
|
|
169 immediately delete it. For example, you could type @kbd{e e @key{DEL}
|
|
170 '} to get separate @samp{e} and @samp{'}.
|
|
171
|
|
172 Another method, more general but not quite as easy to type, is to use
|
|
173 @kbd{C-\ C-\} between two characters to stop them from combining. This
|
|
174 is the command @kbd{C-\} (@code{toggle-input-method}) used twice.
|
|
175 @ifinfo
|
|
176 @xref{Select Input Method}.
|
|
177 @end ifinfo
|
|
178
|
|
179 @kbd{C-\ C-\} is especially useful inside an incremental search,
|
|
180 because stops waiting for more characters to combine, and starts
|
|
181 searching for what you have already entered.
|
|
182
|
|
183 @vindex input-method-verbose-flag
|
|
184 @vindex input-method-highlight-flag
|
|
185 The variables @code{input-method-highlight-flag} and
|
|
186 @code{input-method-verbose-flag} control how input methods explain what
|
|
187 is happening. If @code{input-method-highlight-flag} is non-@code{nil},
|
|
188 the partial sequence is highlighted in the buffer. If
|
|
189 @code{input-method-verbose-flag} is non-@code{nil}, the list of possible
|
|
190 characters to type next is displayed in the echo area (but not when you
|
|
191 are in the minibuffer).
|
|
192
|
|
193 @node Select Input Method, Coding Systems, Input Methods, Mule
|
|
194 @section Selecting an Input Method
|
|
195
|
|
196 @table @kbd
|
|
197 @item C-\
|
|
198 Enable or disable use of the selected input method.
|
|
199
|
|
200 @item C-x @key{RET} C-\ @var{method} @key{RET}
|
|
201 Select a new input method for the current buffer.
|
|
202
|
|
203 @item C-h I @var{method} @key{RET}
|
|
204 @itemx C-h C-\ @var{method} @key{RET}
|
|
205 @findex describe-input-method
|
|
206 @kindex C-h I
|
|
207 @kindex C-h C-\
|
|
208 Describe the input method @var{method} (@code{describe-input-method}).
|
|
209 By default, it describes the current input method (if any).
|
|
210
|
|
211 @item M-x list-input-methods
|
|
212 Display a list of all the supported input methods.
|
|
213 @end table
|
|
214
|
|
215 @findex select-input-method
|
|
216 @vindex current-input-method
|
|
217 @kindex C-x RET C-\
|
|
218 To choose an input method for the current buffer, use @kbd{C-x
|
|
219 @key{RET} C-\} (@code{select-input-method}). This command reads the
|
|
220 input method name with the minibuffer; the name normally starts with the
|
|
221 language environment that it is meant to be used with. The variable
|
|
222 @code{current-input-method} records which input method is selected.
|
600
|
223
|
428
|
224 @findex toggle-input-method
|
|
225 @kindex C-\
|
|
226 Input methods use various sequences of ASCII characters to stand for
|
|
227 non-ASCII characters. Sometimes it is useful to turn off the input
|
|
228 method temporarily. To do this, type @kbd{C-\}
|
|
229 (@code{toggle-input-method}). To reenable the input method, type
|
|
230 @kbd{C-\} again.
|
|
231
|
|
232 If you type @kbd{C-\} and you have not yet selected an input method,
|
|
233 it prompts for you to specify one. This has the same effect as using
|
|
234 @kbd{C-x @key{RET} C-\} to specify an input method.
|
|
235
|
|
236 @vindex default-input-method
|
|
237 Selecting a language environment specifies a default input method for
|
|
238 use in various buffers. When you have a default input method, you can
|
|
239 select it in the current buffer by typing @kbd{C-\}. The variable
|
|
240 @code{default-input-method} specifies the default input method
|
|
241 (@code{nil} means there is none).
|
|
242
|
|
243 @findex quail-set-keyboard-layout
|
|
244 Some input methods for alphabetic scripts work by (in effect)
|
|
245 remapping the keyboard to emulate various keyboard layouts commonly used
|
|
246 for those scripts. How to do this remapping properly depends on your
|
|
247 actual keyboard layout. To specify which layout your keyboard has, use
|
|
248 the command @kbd{M-x quail-set-keyboard-layout}.
|
|
249
|
|
250 @findex list-input-methods
|
|
251 To display a list of all the supported input methods, type @kbd{M-x
|
|
252 list-input-methods}. The list gives information about each input
|
|
253 method, including the string that stands for it in the mode line.
|
|
254
|
|
255 @node Coding Systems, Recognize Coding, Select Input Method, Mule
|
|
256 @section Coding Systems
|
|
257 @cindex coding systems
|
|
258
|
|
259 Users of various languages have established many more-or-less standard
|
|
260 coding systems for representing them. XEmacs does not use these coding
|
|
261 systems internally; instead, it converts from various coding systems to
|
|
262 its own system when reading data, and converts the internal coding
|
|
263 system to other coding systems when writing data. Conversion is
|
|
264 possible in reading or writing files, in sending or receiving from the
|
|
265 terminal, and in exchanging data with subprocesses.
|
|
266
|
|
267 XEmacs assigns a name to each coding system. Most coding systems are
|
|
268 used for one language, and the name of the coding system starts with the
|
|
269 language name. Some coding systems are used for several languages;
|
|
270 their names usually start with @samp{iso}. There are also special
|
|
271 coding systems @code{binary} and @code{no-conversion} which do not
|
|
272 convert printing characters at all.
|
|
273
|
|
274 In addition to converting various representations of non-ASCII
|
|
275 characters, a coding system can perform end-of-line conversion. XEmacs
|
|
276 handles three different conventions for how to separate lines in a file:
|
|
277 newline, carriage-return linefeed, and just carriage-return.
|
|
278
|
|
279 @table @kbd
|
600
|
280 @item C-x @key{RET} C @var{coding} @key{RET}
|
428
|
281 Describe coding system @var{coding}.
|
|
282
|
600
|
283 @item C-x @key{RET} C @key{RET}
|
428
|
284 Describe the coding systems currently in use.
|
|
285
|
|
286 @item M-x list-coding-systems
|
|
287 Display a list of all the supported coding systems.
|
|
288 @end table
|
|
289
|
600
|
290 @item C-u M-x list-coding-systems
|
|
291 Display comprehensive list of specific details of all supported coding
|
|
292 systems.
|
|
293
|
|
294 @kindex C-x RET C
|
428
|
295 @findex describe-coding-system
|
600
|
296 The command @kbd{C-x RET C} (@code{describe-coding-system}) displays
|
428
|
297 information about particular coding systems. You can specify a coding
|
|
298 system name as argument; alternatively, with an empty argument, it
|
|
299 describes the coding systems currently selected for various purposes,
|
|
300 both in the current buffer and as the defaults, and the priority list
|
|
301 for recognizing coding systems (@pxref{Recognize Coding}).
|
|
302
|
|
303 @findex list-coding-systems
|
|
304 To display a list of all the supported coding systems, type @kbd{M-x
|
|
305 list-coding-systems}. The list gives information about each coding
|
|
306 system, including the letter that stands for it in the mode line
|
|
307 (@pxref{Mode Line}).
|
|
308
|
|
309 Each of the coding systems that appear in this list---except for
|
|
310 @code{binary}, which means no conversion of any kind---specifies how and
|
|
311 whether to convert printing characters, but leaves the choice of
|
|
312 end-of-line conversion to be decided based on the contents of each file.
|
|
313 For example, if the file appears to use carriage-return linefeed between
|
|
314 lines, that end-of-line conversion will be used.
|
|
315
|
|
316 Each of the listed coding systems has three variants which specify
|
|
317 exactly what to do for end-of-line conversion:
|
|
318
|
|
319 @table @code
|
|
320 @item @dots{}-unix
|
|
321 Don't do any end-of-line conversion; assume the file uses
|
|
322 newline to separate lines. (This is the convention normally used
|
|
323 on Unix and GNU systems.)
|
|
324
|
|
325 @item @dots{}-dos
|
|
326 Assume the file uses carriage-return linefeed to separate lines,
|
|
327 and do the appropriate conversion. (This is the convention normally used
|
|
328 on Microsoft systems.)
|
|
329
|
|
330 @item @dots{}-mac
|
|
331 Assume the file uses carriage-return to separate lines, and do the
|
|
332 appropriate conversion. (This is the convention normally used on the
|
|
333 Macintosh system.)
|
|
334 @end table
|
|
335
|
|
336 These variant coding systems are omitted from the
|
|
337 @code{list-coding-systems} display for brevity, since they are entirely
|
|
338 predictable. For example, the coding system @code{iso-8859-1} has
|
|
339 variants @code{iso-8859-1-unix}, @code{iso-8859-1-dos} and
|
|
340 @code{iso-8859-1-mac}.
|
|
341
|
|
342 In contrast, the coding system @code{binary} specifies no character
|
|
343 code conversion at all---none for non-Latin-1 byte values and none for
|
|
344 end of line. This is useful for reading or writing binary files, tar
|
|
345 files, and other files that must be examined verbatim.
|
|
346
|
|
347 The easiest way to edit a file with no conversion of any kind is with
|
|
348 the @kbd{M-x find-file-literally} command. This uses @code{binary}, and
|
|
349 also suppresses other XEmacs features that might convert the file
|
|
350 contents before you see them. @xref{Visiting}.
|
|
351
|
|
352 The coding system @code{no-conversion} means that the file contains
|
|
353 non-Latin-1 characters stored with the internal XEmacs encoding. It
|
|
354 handles end-of-line conversion based on the data encountered, and has
|
|
355 the usual three variants to specify the kind of end-of-line conversion.
|
|
356
|
|
357
|
|
358 @node Recognize Coding, Specify Coding, Coding Systems, Mule
|
|
359 @section Recognizing Coding Systems
|
|
360
|
|
361 Most of the time, XEmacs can recognize which coding system to use for
|
|
362 any given file--once you have specified your preferences.
|
|
363
|
|
364 Some coding systems can be recognized or distinguished by which byte
|
|
365 sequences appear in the data. However, there are coding systems that
|
|
366 cannot be distinguished, not even potentially. For example, there is no
|
|
367 way to distinguish between Latin-1 and Latin-2; they use the same byte
|
|
368 values with different meanings.
|
|
369
|
|
370 XEmacs handles this situation by means of a priority list of coding
|
|
371 systems. Whenever XEmacs reads a file, if you do not specify the coding
|
|
372 system to use, XEmacs checks the data against each coding system,
|
|
373 starting with the first in priority and working down the list, until it
|
|
374 finds a coding system that fits the data. Then it converts the file
|
|
375 contents assuming that they are represented in this coding system.
|
|
376
|
|
377 The priority list of coding systems depends on the selected language
|
|
378 environment (@pxref{Language Environments}). For example, if you use
|
|
379 French, you probably want XEmacs to prefer Latin-1 to Latin-2; if you
|
|
380 use Czech, you probably want Latin-2 to be preferred. This is one of
|
|
381 the reasons to specify a language environment.
|
|
382
|
|
383 @findex prefer-coding-system
|
|
384 However, you can alter the priority list in detail with the command
|
|
385 @kbd{M-x prefer-coding-system}. This command reads the name of a coding
|
|
386 system from the minibuffer, and adds it to the front of the priority
|
|
387 list, so that it is preferred to all others. If you use this command
|
|
388 several times, each use adds one element to the front of the priority
|
|
389 list.
|
|
390
|
|
391 @vindex file-coding-system-alist
|
|
392 Sometimes a file name indicates which coding system to use for the
|
|
393 file. The variable @code{file-coding-system-alist} specifies this
|
|
394 correspondence. There is a special function
|
|
395 @code{modify-coding-system-alist} for adding elements to this list. For
|
|
396 example, to read and write all @samp{.txt} using the coding system
|
|
397 @code{china-iso-8bit}, you can execute this Lisp expression:
|
|
398
|
|
399 @smallexample
|
|
400 (modify-coding-system-alist 'file "\\.txt\\'" 'china-iso-8bit)
|
|
401 @end smallexample
|
|
402
|
|
403 @noindent
|
|
404 The first argument should be @code{file}, the second argument should be
|
|
405 a regular expression that determines which files this applies to, and
|
|
406 the third argument says which coding system to use for these files.
|
|
407
|
|
408 @vindex coding
|
|
409 You can specify the coding system for a particular file using the
|
|
410 @samp{-*-@dots{}-*-} construct at the beginning of a file, or a local
|
|
411 variables list at the end (@pxref{File Variables}). You do this by
|
|
412 defining a value for the ``variable'' named @code{coding}. XEmacs does
|
|
413 not really have a variable @code{coding}; instead of setting a variable,
|
|
414 it uses the specified coding system for the file. For example,
|
|
415 @samp{-*-mode: C; coding: iso-8859-1;-*-} specifies use of the
|
|
416 iso-8859-1 coding system, as well as C mode.
|
|
417
|
|
418 @vindex buffer-file-coding-system
|
|
419 Once XEmacs has chosen a coding system for a buffer, it stores that
|
|
420 coding system in @code{buffer-file-coding-system} and uses that coding
|
|
421 system, by default, for operations that write from this buffer into a
|
|
422 file. This includes the commands @code{save-buffer} and
|
|
423 @code{write-region}. If you want to write files from this buffer using
|
|
424 a different coding system, you can specify a different coding system for
|
|
425 the buffer using @code{set-buffer-file-coding-system} (@pxref{Specify
|
|
426 Coding}).
|
|
427
|
|
428
|
|
429 @node Specify Coding, , Recognize Coding, Mule
|
|
430 @section Specifying a Coding System
|
|
431
|
|
432 In cases where XEmacs does not automatically choose the right coding
|
|
433 system, you can use these commands to specify one:
|
|
434
|
|
435 @table @kbd
|
|
436 @item C-x @key{RET} f @var{coding} @key{RET}
|
|
437 Use coding system @var{coding} for the visited file
|
|
438 in the current buffer.
|
|
439
|
|
440 @item C-x @key{RET} c @var{coding} @key{RET}
|
|
441 Specify coding system @var{coding} for the immediately following
|
|
442 command.
|
|
443
|
|
444 @item C-x @key{RET} k @var{coding} @key{RET}
|
600
|
445 Use coding system @var{coding} for keyboard input. (This feature is
|
|
446 non-functional and is temporarily disabled.)
|
428
|
447
|
|
448 @item C-x @key{RET} t @var{coding} @key{RET}
|
|
449 Use coding system @var{coding} for terminal output.
|
|
450
|
|
451 @item C-x @key{RET} p @var{coding} @key{RET}
|
|
452 Use coding system @var{coding} for subprocess input and output
|
|
453 in the current buffer.
|
|
454 @end table
|
|
455
|
|
456 @kindex C-x RET f
|
|
457 @findex set-buffer-file-coding-system
|
|
458 The command @kbd{C-x RET f} (@code{set-buffer-file-coding-system})
|
|
459 specifies the file coding system for the current buffer---in other
|
|
460 words, which coding system to use when saving or rereading the visited
|
|
461 file. You specify which coding system using the minibuffer. Since this
|
|
462 command applies to a file you have already visited, it affects only the
|
|
463 way the file is saved.
|
|
464
|
|
465 @kindex C-x RET c
|
|
466 @findex universal-coding-system-argument
|
|
467 Another way to specify the coding system for a file is when you visit
|
|
468 the file. First use the command @kbd{C-x @key{RET} c}
|
|
469 (@code{universal-coding-system-argument}); this command uses the
|
|
470 minibuffer to read a coding system name. After you exit the minibuffer,
|
|
471 the specified coding system is used for @emph{the immediately following
|
|
472 command}.
|
|
473
|
|
474 So if the immediately following command is @kbd{C-x C-f}, for example,
|
|
475 it reads the file using that coding system (and records the coding
|
|
476 system for when the file is saved). Or if the immediately following
|
|
477 command is @kbd{C-x C-w}, it writes the file using that coding system.
|
|
478 Other file commands affected by a specified coding system include
|
|
479 @kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants of
|
|
480 @kbd{C-x C-f}.
|
|
481
|
|
482 In addition, if you run some file input commands with the precedent
|
|
483 @kbd{C-u}, you can specify coding system to read from minibuffer. So if
|
|
484 the immediately following command is @kbd{C-x C-f}, for example, it
|
|
485 reads the file using that coding system (and records the coding system
|
|
486 for when the file is saved). Other file commands affected by a
|
|
487 specified coding system include @kbd{C-x C-i} and @kbd{C-x C-v}, as well
|
|
488 as the other-window variants of @kbd{C-x C-f}.
|
|
489
|
|
490 @vindex default-buffer-file-coding-system
|
|
491 The variable @code{default-buffer-file-coding-system} specifies the
|
|
492 choice of coding system to use when you create a new file. It applies
|
|
493 when you find a new file, and when you create a buffer and then save it
|
|
494 in a file. Selecting a language environment typically sets this
|
|
495 variable to a good choice of default coding system for that language
|
|
496 environment.
|
|
497
|
|
498 @kindex C-x RET t
|
|
499 @findex set-terminal-coding-system
|
|
500 The command @kbd{C-x @key{RET} t} (@code{set-terminal-coding-system})
|
|
501 specifies the coding system for terminal output. If you specify a
|
|
502 character code for terminal output, all characters output to the
|
|
503 terminal are translated into that coding system.
|
|
504
|
|
505 This feature is useful for certain character-only terminals built to
|
|
506 support specific languages or character sets---for example, European
|
|
507 terminals that support one of the ISO Latin character sets.
|
|
508
|
|
509 By default, output to the terminal is not translated at all.
|
|
510
|
|
511 @kindex C-x RET k
|
|
512 @findex set-keyboard-coding-system
|
|
513 The command @kbd{C-x @key{RET} k} (@code{set-keyboard-coding-system})
|
|
514 specifies the coding system for keyboard input. Character-code
|
|
515 translation of keyboard input is useful for terminals with keys that
|
|
516 send non-ASCII graphic characters---for example, some terminals designed
|
|
517 for ISO Latin-1 or subsets of it.
|
|
518
|
600
|
519 (This feature is non-functional and is temporarily disabled.)
|
|
520
|
428
|
521 By default, keyboard input is not translated at all.
|
|
522
|
|
523 There is a similarity between using a coding system translation for
|
|
524 keyboard input, and using an input method: both define sequences of
|
|
525 keyboard input that translate into single characters. However, input
|
|
526 methods are designed to be convenient for interactive use by humans, and
|
|
527 the sequences that are translated are typically sequences of ASCII
|
|
528 printing characters. Coding systems typically translate sequences of
|
|
529 non-graphic characters.
|
|
530
|
|
531 @kindex C-x RET p
|
|
532 @findex set-buffer-process-coding-system
|
|
533 The command @kbd{C-x @key{RET} p} (@code{set-buffer-process-coding-system})
|
|
534 specifies the coding system for input and output to a subprocess. This
|
|
535 command applies to the current buffer; normally, each subprocess has its
|
|
536 own buffer, and thus you can use this command to specify translation to
|
|
537 and from a particular subprocess by giving the command in the
|
|
538 corresponding buffer.
|
|
539
|
|
540 By default, process input and output are not translated at all.
|
|
541
|
|
542 @vindex file-name-coding-system
|
|
543 The variable @code{file-name-coding-system} specifies a coding system
|
|
544 to use for encoding file names. If you set the variable to a coding
|
|
545 system name (as a Lisp symbol or a string), XEmacs encodes file names
|
|
546 using that coding system for all file operations. This makes it
|
|
547 possible to use non-Latin-1 characters in file names---or, at least,
|
|
548 those non-Latin-1 characters which the specified coding system can
|
|
549 encode. By default, this variable is @code{nil}, which implies that you
|
|
550 cannot use non-Latin-1 characters in file names.
|