aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c213
1 files changed, 69 insertions, 144 deletions
diff --git a/src/coding.c b/src/coding.c
index a7b7c7d6b23..3a3ba11ee9d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,8 +1,7 @@
1/* Coding system handler (conversion, detection, etc). 1/* Coding system handler (conversion, detection, etc).
2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2 Copyright (C) 2001-2011 Free Software Foundation, Inc.
3 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5 2005, 2006, 2007, 2008, 2009, 2010 4 2005, 2006, 2007, 2008, 2009, 2010, 2011
6 National Institute of Advanced Industrial Science and Technology (AIST) 5 National Institute of Advanced Industrial Science and Technology (AIST)
7 Registration Number H14PRO021 6 Registration Number H14PRO021
8 Copyright (C) 2003 7 Copyright (C) 2003
@@ -327,16 +326,6 @@ Lisp_Object Qinterrupted, Qinsufficient_memory;
327 symbol as a coding system. */ 326 symbol as a coding system. */
328static Lisp_Object Qcoding_system_define_form; 327static Lisp_Object Qcoding_system_define_form;
329 328
330int coding_system_require_warning;
331
332Lisp_Object Vselect_safe_coding_system_function;
333
334/* Mnemonic string for each format of end-of-line. */
335Lisp_Object eol_mnemonic_unix, eol_mnemonic_dos, eol_mnemonic_mac;
336/* Mnemonic string to indicate format of end-of-line is not yet
337 decided. */
338Lisp_Object eol_mnemonic_undecided;
339
340/* Format of end-of-line decided by system. This is Qunix on 329/* Format of end-of-line decided by system. This is Qunix on
341 Unix and Mac, Qdos on DOS/Windows. 330 Unix and Mac, Qdos on DOS/Windows.
342 This has an effect only for external encoding (i.e. for output to 331 This has an effect only for external encoding (i.e. for output to
@@ -345,8 +334,6 @@ static Lisp_Object system_eol_type;
345 334
346#ifdef emacs 335#ifdef emacs
347 336
348Lisp_Object Vcoding_system_list, Vcoding_system_alist;
349
350Lisp_Object Qcoding_system_p, Qcoding_system_error; 337Lisp_Object Qcoding_system_p, Qcoding_system_error;
351 338
352/* Coding system emacs-mule and raw-text are for converting only 339/* Coding system emacs-mule and raw-text are for converting only
@@ -356,64 +343,17 @@ Lisp_Object Qutf_8_emacs;
356 343
357/* Coding-systems are handed between Emacs Lisp programs and C internal 344/* Coding-systems are handed between Emacs Lisp programs and C internal
358 routines by the following three variables. */ 345 routines by the following three variables. */
359/* Coding-system for reading files and receiving data from process. */
360Lisp_Object Vcoding_system_for_read;
361/* Coding-system for writing files and sending data to process. */
362Lisp_Object Vcoding_system_for_write;
363/* Coding-system actually used in the latest I/O. */
364Lisp_Object Vlast_coding_system_used;
365/* Set to non-nil when an error is detected while code conversion. */
366Lisp_Object Vlast_code_conversion_error;
367/* A vector of length 256 which contains information about special
368 Latin codes (especially for dealing with Microsoft codes). */
369Lisp_Object Vlatin_extra_code_table;
370
371/* Flag to inhibit code conversion of end-of-line format. */
372int inhibit_eol_conversion;
373
374/* Flag to inhibit ISO2022 escape sequence detection. */
375int inhibit_iso_escape_detection;
376
377/* Flag to inhibit detection of binary files through null bytes. */
378int inhibit_null_byte_detection;
379
380/* Flag to make buffer-file-coding-system inherit from process-coding. */
381int inherit_process_coding_system;
382
383/* Coding system to be used to encode text for terminal display when 346/* Coding system to be used to encode text for terminal display when
384 terminal coding system is nil. */ 347 terminal coding system is nil. */
385struct coding_system safe_terminal_coding; 348struct coding_system safe_terminal_coding;
386 349
387Lisp_Object Vfile_coding_system_alist;
388Lisp_Object Vprocess_coding_system_alist;
389Lisp_Object Vnetwork_coding_system_alist;
390
391Lisp_Object Vlocale_coding_system;
392
393#endif /* emacs */ 350#endif /* emacs */
394 351
395/* Flag to tell if we look up translation table on character code
396 conversion. */
397Lisp_Object Venable_character_translation;
398/* Standard translation table to look up on decoding (reading). */
399Lisp_Object Vstandard_translation_table_for_decode;
400/* Standard translation table to look up on encoding (writing). */
401Lisp_Object Vstandard_translation_table_for_encode;
402
403Lisp_Object Qtranslation_table; 352Lisp_Object Qtranslation_table;
404Lisp_Object Qtranslation_table_id; 353Lisp_Object Qtranslation_table_id;
405Lisp_Object Qtranslation_table_for_decode; 354Lisp_Object Qtranslation_table_for_decode;
406Lisp_Object Qtranslation_table_for_encode; 355Lisp_Object Qtranslation_table_for_encode;
407 356
408/* Alist of charsets vs revision number. */
409static Lisp_Object Vcharset_revision_table;
410
411/* Default coding systems used for process I/O. */
412Lisp_Object Vdefault_process_coding_system;
413
414/* Char table for translating Quail and self-inserting input. */
415Lisp_Object Vtranslation_table_for_input;
416
417/* Two special coding systems. */ 357/* Two special coding systems. */
418Lisp_Object Vsjis_coding_system; 358Lisp_Object Vsjis_coding_system;
419Lisp_Object Vbig5_coding_system; 359Lisp_Object Vbig5_coding_system;
@@ -681,10 +621,6 @@ enum coding_category
681 | CATEGORY_MASK_UTF_8_NOSIG \ 621 | CATEGORY_MASK_UTF_8_NOSIG \
682 | CATEGORY_MASK_UTF_8_SIG) 622 | CATEGORY_MASK_UTF_8_SIG)
683 623
684/* List of symbols `coding-category-xxx' ordered by priority. This
685 variable is exposed to Emacs Lisp. */
686static Lisp_Object Vcoding_category_list;
687
688/* Table of coding categories (Lisp symbols). This variable is for 624/* Table of coding categories (Lisp symbols). This variable is for
689 internal use only. */ 625 internal use only. */
690static Lisp_Object Vcoding_category_table; 626static Lisp_Object Vcoding_category_table;
@@ -1607,10 +1543,9 @@ static int
1607detect_coding_utf_16 (struct coding_system *coding, 1543detect_coding_utf_16 (struct coding_system *coding,
1608 struct coding_detection_info *detect_info) 1544 struct coding_detection_info *detect_info)
1609{ 1545{
1610 const unsigned char *src = coding->source, *src_base = src; 1546 const unsigned char *src = coding->source;
1611 const unsigned char *src_end = coding->source + coding->src_bytes; 1547 const unsigned char *src_end = coding->source + coding->src_bytes;
1612 int multibytep = coding->src_multibyte; 1548 int multibytep = coding->src_multibyte;
1613 int consumed_chars = 0;
1614 int c1, c2; 1549 int c1, c2;
1615 1550
1616 detect_info->checked |= CATEGORY_MASK_UTF_16; 1551 detect_info->checked |= CATEGORY_MASK_UTF_16;
@@ -2277,7 +2212,6 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src,
2277#define DECODE_EMACS_MULE_21_COMPOSITION() \ 2212#define DECODE_EMACS_MULE_21_COMPOSITION() \
2278 do { \ 2213 do { \
2279 enum composition_method method = c - 0xF2; \ 2214 enum composition_method method = c - 0xF2; \
2280 int *charbuf_base = charbuf; \
2281 int nbytes, nchars; \ 2215 int nbytes, nchars; \
2282 \ 2216 \
2283 ONE_MORE_BYTE (c); \ 2217 ONE_MORE_BYTE (c); \
@@ -2633,11 +2567,6 @@ decode_coding_emacs_mule (struct coding_system *coding)
2633 } 2567 }
2634 continue; 2568 continue;
2635 2569
2636 retry:
2637 src = src_base;
2638 consumed_chars = consumed_chars_base;
2639 continue;
2640
2641 invalid_code: 2570 invalid_code:
2642 EMACS_MULE_MAYBE_FINISH_COMPOSITION (); 2571 EMACS_MULE_MAYBE_FINISH_COMPOSITION ();
2643 src = src_base; 2572 src = src_base;
@@ -5450,9 +5379,9 @@ detect_coding_charset (struct coding_system *coding,
5450 attrs = CODING_ID_ATTRS (coding->id); 5379 attrs = CODING_ID_ATTRS (coding->id);
5451 valids = AREF (attrs, coding_attr_charset_valids); 5380 valids = AREF (attrs, coding_attr_charset_valids);
5452 name = CODING_ID_NAME (coding->id); 5381 name = CODING_ID_NAME (coding->id);
5453 if (strncmp ((char *) SDATA (SYMBOL_NAME (name)), 5382 if (strncmp (SSDATA (SYMBOL_NAME (name)),
5454 "iso-8859-", sizeof ("iso-8859-") - 1) == 0 5383 "iso-8859-", sizeof ("iso-8859-") - 1) == 0
5455 || strncmp ((char *) SDATA (SYMBOL_NAME (name)), 5384 || strncmp (SSDATA (SYMBOL_NAME (name)),
5456 "iso-latin-", sizeof ("iso-latin-") - 1) == 0) 5385 "iso-latin-", sizeof ("iso-latin-") - 1) == 0)
5457 check_latin_extra = 1; 5386 check_latin_extra = 1;
5458 5387
@@ -6260,8 +6189,9 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes,
6260 { 6189 {
6261 /* The found type is different from what found before. 6190 /* The found type is different from what found before.
6262 Allow for stray ^M characters in DOS EOL files. */ 6191 Allow for stray ^M characters in DOS EOL files. */
6263 if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF 6192 if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF)
6264 || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) 6193 || (eol_seen == EOL_SEEN_CRLF
6194 && this_eol == EOL_SEEN_CR))
6265 eol_seen = EOL_SEEN_CRLF; 6195 eol_seen = EOL_SEEN_CRLF;
6266 else 6196 else
6267 { 6197 {
@@ -6276,42 +6206,40 @@ detect_eol (const unsigned char *source, EMACS_INT src_bytes,
6276 } 6206 }
6277 } 6207 }
6278 else 6208 else
6279 { 6209 while (src < src_end)
6280 while (src < src_end) 6210 {
6281 { 6211 c = *src++;
6282 c = *src++; 6212 if (c == '\n' || c == '\r')
6283 if (c == '\n' || c == '\r') 6213 {
6284 { 6214 int this_eol;
6285 int this_eol;
6286 6215
6287 if (c == '\n') 6216 if (c == '\n')
6288 this_eol = EOL_SEEN_LF; 6217 this_eol = EOL_SEEN_LF;
6289 else if (src >= src_end || *src != '\n') 6218 else if (src >= src_end || *src != '\n')
6290 this_eol = EOL_SEEN_CR; 6219 this_eol = EOL_SEEN_CR;
6291 else 6220 else
6292 this_eol = EOL_SEEN_CRLF, src++; 6221 this_eol = EOL_SEEN_CRLF, src++;
6293 6222
6294 if (eol_seen == EOL_SEEN_NONE) 6223 if (eol_seen == EOL_SEEN_NONE)
6295 /* This is the first end-of-line. */ 6224 /* This is the first end-of-line. */
6296 eol_seen = this_eol; 6225 eol_seen = this_eol;
6297 else if (eol_seen != this_eol) 6226 else if (eol_seen != this_eol)
6298 { 6227 {
6299 /* The found type is different from what found before. 6228 /* The found type is different from what found before.
6300 Allow for stray ^M characters in DOS EOL files. */ 6229 Allow for stray ^M characters in DOS EOL files. */
6301 if (eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF 6230 if ((eol_seen == EOL_SEEN_CR && this_eol == EOL_SEEN_CRLF)
6302 || eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR) 6231 || (eol_seen == EOL_SEEN_CRLF && this_eol == EOL_SEEN_CR))
6303 eol_seen = EOL_SEEN_CRLF; 6232 eol_seen = EOL_SEEN_CRLF;
6304 else 6233 else
6305 { 6234 {
6306 eol_seen = EOL_SEEN_LF; 6235 eol_seen = EOL_SEEN_LF;
6307 break; 6236 break;
6308 } 6237 }
6309 } 6238 }
6310 if (++total == MAX_EOL_CHECK_COUNT) 6239 if (++total == MAX_EOL_CHECK_COUNT)
6311 break; 6240 break;
6312 } 6241 }
6313 } 6242 }
6314 }
6315 return eol_seen; 6243 return eol_seen;
6316} 6244}
6317 6245
@@ -10533,7 +10461,7 @@ syms_of_coding (void)
10533 defsubr (&Scoding_system_eol_type); 10461 defsubr (&Scoding_system_eol_type);
10534 defsubr (&Scoding_system_priority_list); 10462 defsubr (&Scoding_system_priority_list);
10535 10463
10536 DEFVAR_LISP ("coding-system-list", &Vcoding_system_list, 10464 DEFVAR_LISP ("coding-system-list", Vcoding_system_list,
10537 doc: /* List of coding systems. 10465 doc: /* List of coding systems.
10538 10466
10539Do not alter the value of this variable manually. This variable should be 10467Do not alter the value of this variable manually. This variable should be
@@ -10541,7 +10469,7 @@ updated by the functions `define-coding-system' and
10541`define-coding-system-alias'. */); 10469`define-coding-system-alias'. */);
10542 Vcoding_system_list = Qnil; 10470 Vcoding_system_list = Qnil;
10543 10471
10544 DEFVAR_LISP ("coding-system-alist", &Vcoding_system_alist, 10472 DEFVAR_LISP ("coding-system-alist", Vcoding_system_alist,
10545 doc: /* Alist of coding system names. 10473 doc: /* Alist of coding system names.
10546Each element is one element list of coding system name. 10474Each element is one element list of coding system name.
10547This variable is given to `completing-read' as COLLECTION argument. 10475This variable is given to `completing-read' as COLLECTION argument.
@@ -10551,7 +10479,7 @@ updated by the functions `make-coding-system' and
10551`define-coding-system-alias'. */); 10479`define-coding-system-alias'. */);
10552 Vcoding_system_alist = Qnil; 10480 Vcoding_system_alist = Qnil;
10553 10481
10554 DEFVAR_LISP ("coding-category-list", &Vcoding_category_list, 10482 DEFVAR_LISP ("coding-category-list", Vcoding_category_list,
10555 doc: /* List of coding-categories (symbols) ordered by priority. 10483 doc: /* List of coding-categories (symbols) ordered by priority.
10556 10484
10557On detecting a coding system, Emacs tries code detection algorithms 10485On detecting a coding system, Emacs tries code detection algorithms
@@ -10570,7 +10498,7 @@ Don't modify this variable directly, but use `set-coding-system-priority'. */);
10570 Vcoding_category_list); 10498 Vcoding_category_list);
10571 } 10499 }
10572 10500
10573 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read, 10501 DEFVAR_LISP ("coding-system-for-read", Vcoding_system_for_read,
10574 doc: /* Specify the coding system for read operations. 10502 doc: /* Specify the coding system for read operations.
10575It is useful to bind this variable with `let', but do not set it globally. 10503It is useful to bind this variable with `let', but do not set it globally.
10576If the value is a coding system, it is used for decoding on read operation. 10504If the value is a coding system, it is used for decoding on read operation.
@@ -10579,7 +10507,7 @@ There are three such tables: `file-coding-system-alist',
10579`process-coding-system-alist', and `network-coding-system-alist'. */); 10507`process-coding-system-alist', and `network-coding-system-alist'. */);
10580 Vcoding_system_for_read = Qnil; 10508 Vcoding_system_for_read = Qnil;
10581 10509
10582 DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write, 10510 DEFVAR_LISP ("coding-system-for-write", Vcoding_system_for_write,
10583 doc: /* Specify the coding system for write operations. 10511 doc: /* Specify the coding system for write operations.
10584Programs bind this variable with `let', but you should not set it globally. 10512Programs bind this variable with `let', but you should not set it globally.
10585If the value is a coding system, it is used for encoding of output, 10513If the value is a coding system, it is used for encoding of output,
@@ -10593,12 +10521,12 @@ For output to files, if the above procedure does not specify a coding system,
10593the value of `buffer-file-coding-system' is used. */); 10521the value of `buffer-file-coding-system' is used. */);
10594 Vcoding_system_for_write = Qnil; 10522 Vcoding_system_for_write = Qnil;
10595 10523
10596 DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used, 10524 DEFVAR_LISP ("last-coding-system-used", Vlast_coding_system_used,
10597 doc: /* 10525 doc: /*
10598Coding system used in the latest file or process I/O. */); 10526Coding system used in the latest file or process I/O. */);
10599 Vlast_coding_system_used = Qnil; 10527 Vlast_coding_system_used = Qnil;
10600 10528
10601 DEFVAR_LISP ("last-code-conversion-error", &Vlast_code_conversion_error, 10529 DEFVAR_LISP ("last-code-conversion-error", Vlast_code_conversion_error,
10602 doc: /* 10530 doc: /*
10603Error status of the last code conversion. 10531Error status of the last code conversion.
10604 10532
@@ -10615,21 +10543,21 @@ explicitly set this variable to nil before performing code
10615conversion. */); 10543conversion. */);
10616 Vlast_code_conversion_error = Qnil; 10544 Vlast_code_conversion_error = Qnil;
10617 10545
10618 DEFVAR_BOOL ("inhibit-eol-conversion", &inhibit_eol_conversion, 10546 DEFVAR_BOOL ("inhibit-eol-conversion", inhibit_eol_conversion,
10619 doc: /* 10547 doc: /*
10620*Non-nil means always inhibit code conversion of end-of-line format. 10548*Non-nil means always inhibit code conversion of end-of-line format.
10621See info node `Coding Systems' and info node `Text and Binary' concerning 10549See info node `Coding Systems' and info node `Text and Binary' concerning
10622such conversion. */); 10550such conversion. */);
10623 inhibit_eol_conversion = 0; 10551 inhibit_eol_conversion = 0;
10624 10552
10625 DEFVAR_BOOL ("inherit-process-coding-system", &inherit_process_coding_system, 10553 DEFVAR_BOOL ("inherit-process-coding-system", inherit_process_coding_system,
10626 doc: /* 10554 doc: /*
10627Non-nil means process buffer inherits coding system of process output. 10555Non-nil means process buffer inherits coding system of process output.
10628Bind it to t if the process output is to be treated as if it were a file 10556Bind it to t if the process output is to be treated as if it were a file
10629read from some filesystem. */); 10557read from some filesystem. */);
10630 inherit_process_coding_system = 0; 10558 inherit_process_coding_system = 0;
10631 10559
10632 DEFVAR_LISP ("file-coding-system-alist", &Vfile_coding_system_alist, 10560 DEFVAR_LISP ("file-coding-system-alist", Vfile_coding_system_alist,
10633 doc: /* 10561 doc: /*
10634Alist to decide a coding system to use for a file I/O operation. 10562Alist to decide a coding system to use for a file I/O operation.
10635The format is ((PATTERN . VAL) ...), 10563The format is ((PATTERN . VAL) ...),
@@ -10650,7 +10578,7 @@ See also the function `find-operation-coding-system'
10650and the variable `auto-coding-alist'. */); 10578and the variable `auto-coding-alist'. */);
10651 Vfile_coding_system_alist = Qnil; 10579 Vfile_coding_system_alist = Qnil;
10652 10580
10653 DEFVAR_LISP ("process-coding-system-alist", &Vprocess_coding_system_alist, 10581 DEFVAR_LISP ("process-coding-system-alist", Vprocess_coding_system_alist,
10654 doc: /* 10582 doc: /*
10655Alist to decide a coding system to use for a process I/O operation. 10583Alist to decide a coding system to use for a process I/O operation.
10656The format is ((PATTERN . VAL) ...), 10584The format is ((PATTERN . VAL) ...),
@@ -10666,7 +10594,7 @@ or a cons of coding systems which are used as above.
10666See also the function `find-operation-coding-system'. */); 10594See also the function `find-operation-coding-system'. */);
10667 Vprocess_coding_system_alist = Qnil; 10595 Vprocess_coding_system_alist = Qnil;
10668 10596
10669 DEFVAR_LISP ("network-coding-system-alist", &Vnetwork_coding_system_alist, 10597 DEFVAR_LISP ("network-coding-system-alist", Vnetwork_coding_system_alist,
10670 doc: /* 10598 doc: /*
10671Alist to decide a coding system to use for a network I/O operation. 10599Alist to decide a coding system to use for a network I/O operation.
10672The format is ((PATTERN . VAL) ...), 10600The format is ((PATTERN . VAL) ...),
@@ -10683,48 +10611,48 @@ or a cons of coding systems which are used as above.
10683See also the function `find-operation-coding-system'. */); 10611See also the function `find-operation-coding-system'. */);
10684 Vnetwork_coding_system_alist = Qnil; 10612 Vnetwork_coding_system_alist = Qnil;
10685 10613
10686 DEFVAR_LISP ("locale-coding-system", &Vlocale_coding_system, 10614 DEFVAR_LISP ("locale-coding-system", Vlocale_coding_system,
10687 doc: /* Coding system to use with system messages. 10615 doc: /* Coding system to use with system messages.
10688Also used for decoding keyboard input on X Window system. */); 10616Also used for decoding keyboard input on X Window system. */);
10689 Vlocale_coding_system = Qnil; 10617 Vlocale_coding_system = Qnil;
10690 10618
10691 /* The eol mnemonics are reset in startup.el system-dependently. */ 10619 /* The eol mnemonics are reset in startup.el system-dependently. */
10692 DEFVAR_LISP ("eol-mnemonic-unix", &eol_mnemonic_unix, 10620 DEFVAR_LISP ("eol-mnemonic-unix", eol_mnemonic_unix,
10693 doc: /* 10621 doc: /*
10694*String displayed in mode line for UNIX-like (LF) end-of-line format. */); 10622*String displayed in mode line for UNIX-like (LF) end-of-line format. */);
10695 eol_mnemonic_unix = make_pure_c_string (":"); 10623 eol_mnemonic_unix = make_pure_c_string (":");
10696 10624
10697 DEFVAR_LISP ("eol-mnemonic-dos", &eol_mnemonic_dos, 10625 DEFVAR_LISP ("eol-mnemonic-dos", eol_mnemonic_dos,
10698 doc: /* 10626 doc: /*
10699*String displayed in mode line for DOS-like (CRLF) end-of-line format. */); 10627*String displayed in mode line for DOS-like (CRLF) end-of-line format. */);
10700 eol_mnemonic_dos = make_pure_c_string ("\\"); 10628 eol_mnemonic_dos = make_pure_c_string ("\\");
10701 10629
10702 DEFVAR_LISP ("eol-mnemonic-mac", &eol_mnemonic_mac, 10630 DEFVAR_LISP ("eol-mnemonic-mac", eol_mnemonic_mac,
10703 doc: /* 10631 doc: /*
10704*String displayed in mode line for MAC-like (CR) end-of-line format. */); 10632*String displayed in mode line for MAC-like (CR) end-of-line format. */);
10705 eol_mnemonic_mac = make_pure_c_string ("/"); 10633 eol_mnemonic_mac = make_pure_c_string ("/");
10706 10634
10707 DEFVAR_LISP ("eol-mnemonic-undecided", &eol_mnemonic_undecided, 10635 DEFVAR_LISP ("eol-mnemonic-undecided", eol_mnemonic_undecided,
10708 doc: /* 10636 doc: /*
10709*String displayed in mode line when end-of-line format is not yet determined. */); 10637*String displayed in mode line when end-of-line format is not yet determined. */);
10710 eol_mnemonic_undecided = make_pure_c_string (":"); 10638 eol_mnemonic_undecided = make_pure_c_string (":");
10711 10639
10712 DEFVAR_LISP ("enable-character-translation", &Venable_character_translation, 10640 DEFVAR_LISP ("enable-character-translation", Venable_character_translation,
10713 doc: /* 10641 doc: /*
10714*Non-nil enables character translation while encoding and decoding. */); 10642*Non-nil enables character translation while encoding and decoding. */);
10715 Venable_character_translation = Qt; 10643 Venable_character_translation = Qt;
10716 10644
10717 DEFVAR_LISP ("standard-translation-table-for-decode", 10645 DEFVAR_LISP ("standard-translation-table-for-decode",
10718 &Vstandard_translation_table_for_decode, 10646 Vstandard_translation_table_for_decode,
10719 doc: /* Table for translating characters while decoding. */); 10647 doc: /* Table for translating characters while decoding. */);
10720 Vstandard_translation_table_for_decode = Qnil; 10648 Vstandard_translation_table_for_decode = Qnil;
10721 10649
10722 DEFVAR_LISP ("standard-translation-table-for-encode", 10650 DEFVAR_LISP ("standard-translation-table-for-encode",
10723 &Vstandard_translation_table_for_encode, 10651 Vstandard_translation_table_for_encode,
10724 doc: /* Table for translating characters while encoding. */); 10652 doc: /* Table for translating characters while encoding. */);
10725 Vstandard_translation_table_for_encode = Qnil; 10653 Vstandard_translation_table_for_encode = Qnil;
10726 10654
10727 DEFVAR_LISP ("charset-revision-table", &Vcharset_revision_table, 10655 DEFVAR_LISP ("charset-revision-table", Vcharset_revision_table,
10728 doc: /* Alist of charsets vs revision numbers. 10656 doc: /* Alist of charsets vs revision numbers.
10729While encoding, if a charset (car part of an element) is found, 10657While encoding, if a charset (car part of an element) is found,
10730designate it with the escape sequence identifying revision (cdr part 10658designate it with the escape sequence identifying revision (cdr part
@@ -10732,13 +10660,13 @@ of the element). */);
10732 Vcharset_revision_table = Qnil; 10660 Vcharset_revision_table = Qnil;
10733 10661
10734 DEFVAR_LISP ("default-process-coding-system", 10662 DEFVAR_LISP ("default-process-coding-system",
10735 &Vdefault_process_coding_system, 10663 Vdefault_process_coding_system,
10736 doc: /* Cons of coding systems used for process I/O by default. 10664 doc: /* Cons of coding systems used for process I/O by default.
10737The car part is used for decoding a process output, 10665The car part is used for decoding a process output,
10738the cdr part is used for encoding a text to be sent to a process. */); 10666the cdr part is used for encoding a text to be sent to a process. */);
10739 Vdefault_process_coding_system = Qnil; 10667 Vdefault_process_coding_system = Qnil;
10740 10668
10741 DEFVAR_LISP ("latin-extra-code-table", &Vlatin_extra_code_table, 10669 DEFVAR_LISP ("latin-extra-code-table", Vlatin_extra_code_table,
10742 doc: /* 10670 doc: /*
10743Table of extra Latin codes in the range 128..159 (inclusive). 10671Table of extra Latin codes in the range 128..159 (inclusive).
10744This is a vector of length 256. 10672This is a vector of length 256.
@@ -10751,7 +10679,7 @@ Only 128th through 159th elements have a meaning. */);
10751 Vlatin_extra_code_table = Fmake_vector (make_number (256), Qnil); 10679 Vlatin_extra_code_table = Fmake_vector (make_number (256), Qnil);
10752 10680
10753 DEFVAR_LISP ("select-safe-coding-system-function", 10681 DEFVAR_LISP ("select-safe-coding-system-function",
10754 &Vselect_safe_coding_system_function, 10682 Vselect_safe_coding_system_function,
10755 doc: /* 10683 doc: /*
10756Function to call to select safe coding system for encoding a text. 10684Function to call to select safe coding system for encoding a text.
10757 10685
@@ -10765,7 +10693,7 @@ The default value is `select-safe-coding-system' (which see). */);
10765 Vselect_safe_coding_system_function = Qnil; 10693 Vselect_safe_coding_system_function = Qnil;
10766 10694
10767 DEFVAR_BOOL ("coding-system-require-warning", 10695 DEFVAR_BOOL ("coding-system-require-warning",
10768 &coding_system_require_warning, 10696 coding_system_require_warning,
10769 doc: /* Internal use only. 10697 doc: /* Internal use only.
10770If non-nil, on writing a file, `select-safe-coding-system-function' is 10698If non-nil, on writing a file, `select-safe-coding-system-function' is
10771called even if `coding-system-for-write' is non-nil. The command 10699called even if `coding-system-for-write' is non-nil. The command
@@ -10774,7 +10702,7 @@ called even if `coding-system-for-write' is non-nil. The command
10774 10702
10775 10703
10776 DEFVAR_BOOL ("inhibit-iso-escape-detection", 10704 DEFVAR_BOOL ("inhibit-iso-escape-detection",
10777 &inhibit_iso_escape_detection, 10705 inhibit_iso_escape_detection,
10778 doc: /* 10706 doc: /*
10779If non-nil, Emacs ignores ISO-2022 escape sequences during code detection. 10707If non-nil, Emacs ignores ISO-2022 escape sequences during code detection.
10780 10708
@@ -10802,7 +10730,7 @@ escape sequence (e.g `latin-1') on reading by \\[universal-coding-system-argumen
10802 inhibit_iso_escape_detection = 0; 10730 inhibit_iso_escape_detection = 0;
10803 10731
10804 DEFVAR_BOOL ("inhibit-null-byte-detection", 10732 DEFVAR_BOOL ("inhibit-null-byte-detection",
10805 &inhibit_null_byte_detection, 10733 inhibit_null_byte_detection,
10806 doc: /* If non-nil, Emacs ignores null bytes on code detection. 10734 doc: /* If non-nil, Emacs ignores null bytes on code detection.
10807By default, Emacs treats it as binary data, and does not attempt to 10735By default, Emacs treats it as binary data, and does not attempt to
10808decode it. The effect is as if you specified `no-conversion' for 10736decode it. The effect is as if you specified `no-conversion' for
@@ -10814,7 +10742,7 @@ from GNU Find and GNU Grep. Emacs will then ignore the null bytes and
10814decode text as usual. */); 10742decode text as usual. */);
10815 inhibit_null_byte_detection = 0; 10743 inhibit_null_byte_detection = 0;
10816 10744
10817 DEFVAR_LISP ("translation-table-for-input", &Vtranslation_table_for_input, 10745 DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input,
10818 doc: /* Char table for translating self-inserting characters. 10746 doc: /* Char table for translating self-inserting characters.
10819This is applied to the result of input methods, not their input. 10747This is applied to the result of input methods, not their input.
10820See also `keyboard-translate-table'. 10748See also `keyboard-translate-table'.
@@ -10898,13 +10826,10 @@ emacs_strerror (int error_number)
10898 Lisp_Object dec = code_convert_string_norecord (build_string (str), 10826 Lisp_Object dec = code_convert_string_norecord (build_string (str),
10899 Vlocale_coding_system, 10827 Vlocale_coding_system,
10900 0); 10828 0);
10901 str = (char *) SDATA (dec); 10829 str = SSDATA (dec);
10902 } 10830 }
10903 10831
10904 return str; 10832 return str;
10905} 10833}
10906 10834
10907#endif /* emacs */ 10835#endif /* emacs */
10908
10909/* arch-tag: 3a3a2b01-5ff6-4071-9afe-f5b808d9229d
10910 (do not change this comment) */