diff options
| author | Richard M. Stallman | 2003-07-22 15:15:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-07-22 15:15:20 +0000 |
| commit | 131bf943644db99c59a783050ab78d70e4bae2cc (patch) | |
| tree | f73209ff6cdb06c29061bd66559fe0e1766e0066 | |
| parent | 7370e0a883b48e66b815f131f3b9b610a20d8491 (diff) | |
| download | emacs-131bf943644db99c59a783050ab78d70e4bae2cc.tar.gz emacs-131bf943644db99c59a783050ab78d70e4bae2cc.zip | |
(Converting Representations): Add string-to-multibyte.
(Translation of Characters): Add translation-table-for-input.
(Default Coding Systems): Add auto-coding-functions.
(Explicit Encoding): Add decode-coding-inserted-region.
(Locales): Add locale-info.
| -rw-r--r-- | lispref/nonascii.texi | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi index 888c5cba796..12f3afd5f4d 100644 --- a/lispref/nonascii.texi +++ b/lispref/nonascii.texi | |||
| @@ -191,6 +191,12 @@ The function @code{unibyte-char-to-multibyte} is used to convert | |||
| 191 | each unibyte character to a multibyte character. | 191 | each unibyte character to a multibyte character. |
| 192 | @end defun | 192 | @end defun |
| 193 | 193 | ||
| 194 | @defun string-to-multibyte string | ||
| 195 | This function returns a multibyte string containing the same sequence | ||
| 196 | of character codes as @var{string}. If @var{string} is a multibyte | ||
| 197 | string, the value is the equal to @var{string}. | ||
| 198 | @end defun | ||
| 199 | |||
| 194 | @node Selecting a Representation | 200 | @node Selecting a Representation |
| 195 | @section Selecting a Representation | 201 | @section Selecting a Representation |
| 196 | 202 | ||
| @@ -505,6 +511,11 @@ This is the default translation table for encoding, for | |||
| 505 | coding systems that don't specify any other translation table. | 511 | coding systems that don't specify any other translation table. |
| 506 | @end defvar | 512 | @end defvar |
| 507 | 513 | ||
| 514 | @defvar translation-table-for-input | ||
| 515 | Self-inserting characters are translated through this translation | ||
| 516 | table before they are inserted. | ||
| 517 | @end defvar | ||
| 518 | |||
| 508 | @node Coding Systems | 519 | @node Coding Systems |
| 509 | @section Coding Systems | 520 | @section Coding Systems |
| 510 | 521 | ||
| @@ -887,6 +898,22 @@ The value should be a cons cell of the form @code{(@var{input-coding} | |||
| 887 | the subprocess, and @var{output-coding} applies to output to it. | 898 | the subprocess, and @var{output-coding} applies to output to it. |
| 888 | @end defvar | 899 | @end defvar |
| 889 | 900 | ||
| 901 | @defvar auto-coding-functions | ||
| 902 | This variable holds a list of functions that try to determine a | ||
| 903 | coding system for a file based on its undecoded contents. | ||
| 904 | |||
| 905 | Each function in this list should be written to look at text in the | ||
| 906 | current buffer, but should not modify it in any way. The buffer will | ||
| 907 | contain undecoded text of parts of the file. Each function should | ||
| 908 | take one argument, @var{size}, which tells it how many characters to | ||
| 909 | look at, starting from point. If the function succeeds in determining | ||
| 910 | a coding system for the file, it should return that coding system. | ||
| 911 | Otherwise, it should return @code{nil}. | ||
| 912 | |||
| 913 | If a file has a @samp{coding:} tag, that takes precedence, so these | ||
| 914 | functions won't be called. | ||
| 915 | @end defvar | ||
| 916 | |||
| 890 | @defun find-operation-coding-system operation &rest arguments | 917 | @defun find-operation-coding-system operation &rest arguments |
| 891 | This function returns the coding system to use (by default) for | 918 | This function returns the coding system to use (by default) for |
| 892 | performing @var{operation} with @var{arguments}. The value has this | 919 | performing @var{operation} with @var{arguments}. The value has this |
| @@ -1040,6 +1067,17 @@ decoded text. To make explicit decoding useful, the contents of | |||
| 1040 | string is acceptable. | 1067 | string is acceptable. |
| 1041 | @end defun | 1068 | @end defun |
| 1042 | 1069 | ||
| 1070 | @defun decode-coding-inserted-region from to filename &optional visit beg end replace | ||
| 1071 | This function decodes the text from @var{from} to @var{to} as if | ||
| 1072 | it were being read from file @var{filename} using @code{insert-file-contents} | ||
| 1073 | using the rest of the arguments provided. | ||
| 1074 | |||
| 1075 | The normal way to use this function is after reading text from a file | ||
| 1076 | without decoding, if you decide you would rather have decoded it. | ||
| 1077 | Instead of deleting the text and reading it again, this time with | ||
| 1078 | decoding, you can call this function. | ||
| 1079 | @end defun | ||
| 1080 | |||
| 1043 | @node Terminal I/O Encoding | 1081 | @node Terminal I/O Encoding |
| 1044 | @subsection Terminal I/O Encoding | 1082 | @subsection Terminal I/O Encoding |
| 1045 | 1083 | ||
| @@ -1235,3 +1273,31 @@ conventions of a different language. If the variable is @code{nil}, the | |||
| 1235 | locale is specified by environment variables in the usual POSIX fashion. | 1273 | locale is specified by environment variables in the usual POSIX fashion. |
| 1236 | @end defvar | 1274 | @end defvar |
| 1237 | 1275 | ||
| 1276 | @defun locale-info item | ||
| 1277 | This function returns locale data @var{item} for the current POSIX | ||
| 1278 | locale, if available. @var{item} should be one of these symbols: | ||
| 1279 | |||
| 1280 | @table @code | ||
| 1281 | @item codeset | ||
| 1282 | Return the character set as a string (locale item @code{CODESET}). | ||
| 1283 | |||
| 1284 | @item days | ||
| 1285 | Return a 7-element vector of day names (locale items | ||
| 1286 | @code{DAY_1} through @code{DAY_7}); | ||
| 1287 | |||
| 1288 | @item months | ||
| 1289 | Return a 12-element vector of month names (locale items @code{MON_1} | ||
| 1290 | through @code{MON_12}). | ||
| 1291 | |||
| 1292 | @item paper | ||
| 1293 | Return a list @code{(@var{width} @var{height})} for the default paper | ||
| 1294 | size measured in milimeters (locale items @code{PAPER_WIDTH} and | ||
| 1295 | @code{PAPER_HEIGHT}). | ||
| 1296 | @end table | ||
| 1297 | |||
| 1298 | If the system can't provide the requested information, or if | ||
| 1299 | @var{item} is not one of those symbols, the value is @code{nil}. All | ||
| 1300 | strings in the return value are decoded using | ||
| 1301 | @code{locale-coding-system}. @xref{Locales,,, libc, GNU Libc Manual}, | ||
| 1302 | for more information about locales and locale items. | ||
| 1303 | @end defun | ||