aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-02-17 01:04:35 +0000
committerRichard M. Stallman2004-02-17 01:04:35 +0000
commita3d3f60db6255aecb481b0b9b2ab1da8f53eb6c1 (patch)
treedb95d43bf4e8330481179830892e3568f4a09b81
parentcf11ad960ac195229f4a209185929973072d5040 (diff)
downloademacs-a3d3f60db6255aecb481b0b9b2ab1da8f53eb6c1.tar.gz
emacs-a3d3f60db6255aecb481b0b9b2ab1da8f53eb6c1.zip
(Translation of Characters): Give examples of use.
Explain about translation-table-for-input and set-buffer-file-coding-system. Minor typo fix.
-rw-r--r--lispref/nonascii.texi16
1 files changed, 14 insertions, 2 deletions
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index 419a23efae7..62bd28fd78b 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -17,7 +17,7 @@ characters and how they are stored in strings and buffers.
17* Selecting a Representation:: Treating a byte sequence as unibyte or multi. 17* Selecting a Representation:: Treating a byte sequence as unibyte or multi.
18* Character Codes:: How unibyte and multibyte relate to 18* Character Codes:: How unibyte and multibyte relate to
19 codes of individual characters. 19 codes of individual characters.
20* Character Sets:: The space of possible characters codes 20* Character Sets:: The space of possible character codes
21 is divided into various character sets. 21 is divided into various character sets.
22* Chars and Bytes:: More information about multibyte encodings. 22* Chars and Bytes:: More information about multibyte encodings.
23* Splitting Characters:: Converting a character to its byte sequence. 23* Splitting Characters:: Converting a character to its byte sequence.
@@ -503,6 +503,14 @@ decoding, and for other purposes. Some coding systems specify their
503own particular translation tables; there are also default translation 503own particular translation tables; there are also default translation
504tables which apply to all other coding systems. 504tables which apply to all other coding systems.
505 505
506 For instance, the coding-system @code{utf-8} has a translation table
507that maps characters of various charsets (e.g.,
508@code{latin-iso8859-@var{x}}) into Unicode character sets. This way,
509it can encode Latin-2 characters into UTF-8. Meanwhile,
510@code{unify-8859-on-decoding-mode} operates by specifying
511@code{standard-translation-table-for-decode} to translate
512Latin-@var{x} characters into corresponding Unicode characters.
513
506@defun make-translation-table &rest translations 514@defun make-translation-table &rest translations
507This function returns a translation table based on the argument 515This function returns a translation table based on the argument
508@var{translations}. Each element of @var{translations} should be a 516@var{translations}. Each element of @var{translations} should be a
@@ -558,6 +566,10 @@ coding systems that don't specify any other translation table.
558Self-inserting characters are translated through this translation 566Self-inserting characters are translated through this translation
559table before they are inserted. This variable automatically becomes 567table before they are inserted. This variable automatically becomes
560buffer-local when set. 568buffer-local when set.
569
570@code{set-buffer-file-coding-system} sets this variable so that your
571keyboard input gets translated into the character sets that the buffer
572is likely to contain.
561@end defvar 573@end defvar
562 574
563@node Coding Systems 575@node Coding Systems
@@ -1065,7 +1077,7 @@ of the right way to use the variable:
1065@example 1077@example
1066;; @r{Read the file with no character code conversion.} 1078;; @r{Read the file with no character code conversion.}
1067;; @r{Assume @acronym{crlf} represents end-of-line.} 1079;; @r{Assume @acronym{crlf} represents end-of-line.}
1068(let ((coding-system-for-write 'emacs-mule-dos)) 1080(let ((coding-system-for-read 'emacs-mule-dos))
1069 (insert-file-contents filename)) 1081 (insert-file-contents filename))
1070@end example 1082@end example
1071 1083