Mercurial > hg > xemacs-beta
comparison src/mule-coding.c @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 8619ce7e4c50 |
children | 8eaf7971accc |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
34 | 34 |
35 Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; | 35 Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; |
36 | 36 |
37 Lisp_Object Vkeyboard_coding_system; | 37 Lisp_Object Vkeyboard_coding_system; |
38 Lisp_Object Vterminal_coding_system; | 38 Lisp_Object Vterminal_coding_system; |
39 Lisp_Object Vprocess_input_coding_system; | 39 Lisp_Object Vcoding_system_for_read; |
40 Lisp_Object Vprocess_output_coding_system; | 40 Lisp_Object Vcoding_system_for_write; |
41 Lisp_Object Vpathname_coding_system; | 41 Lisp_Object Vpathname_coding_system; |
42 | 42 |
43 /* Table of symbols identifying each coding category. */ | 43 /* Table of symbols identifying each coding category. */ |
44 Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; | 44 Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; |
45 | 45 |
572 DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /* | 572 DEFUN ("make-coding-system", Fmake_coding_system, 2, 4, 0, /* |
573 Register symbol NAME as a coding system. | 573 Register symbol NAME as a coding system. |
574 | 574 |
575 TYPE describes the conversion method used and should be one of | 575 TYPE describes the conversion method used and should be one of |
576 | 576 |
577 nil or 'autodetect | 577 nil or 'automatic-conversion |
578 Automatic conversion. XEmacs attempts to detect the coding system | 578 Automatic conversion. XEmacs attempts to detect the coding system |
579 used in the file. | 579 used in the file. |
580 'no-conversion | 580 'no-conversion |
581 No conversion. Use this for binary files and such. On output, | 581 No conversion. Use this for binary files and such. On output, |
582 graphic characters that are not in ASCII or Latin-1 will be | 582 graphic characters that are not in ASCII or Latin-1 will be |
742 Lisp_Object rest, key, value; | 742 Lisp_Object rest, key, value; |
743 int ty; | 743 int ty; |
744 int need_to_setup_eol_systems = 1; | 744 int need_to_setup_eol_systems = 1; |
745 | 745 |
746 /* Convert type to constant */ | 746 /* Convert type to constant */ |
747 if (NILP (type) || EQ (type, Qautodetect)) { ty = CODESYS_AUTODETECT; } | 747 if (NILP (type) || EQ (type, Qautomatic_conversion)) |
748 else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; } | 748 { ty = CODESYS_AUTODETECT; } |
749 else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; } | 749 else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; } |
750 else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; } | 750 else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; } |
751 else if (EQ (type, Qccl)) { ty = CODESYS_CCL; } | 751 else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; } |
752 else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; } | 752 else if (EQ (type, Qccl)) { ty = CODESYS_CCL; } |
753 else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; } | |
753 #ifdef DEBUG_XEMACS | 754 #ifdef DEBUG_XEMACS |
754 else if (EQ (type, Qinternal)) { ty = CODESYS_INTERNAL; } | 755 else if (EQ (type, Qinternal)) { ty = CODESYS_INTERNAL; } |
755 #endif | 756 #endif |
756 else | 757 else |
757 signal_simple_error ("Invalid coding system type", type); | 758 signal_simple_error ("Invalid coding system type", type); |
758 | 759 |
759 CHECK_SYMBOL (name); | 760 CHECK_SYMBOL (name); |
944 */ | 945 */ |
945 (coding_system)) | 946 (coding_system)) |
946 { | 947 { |
947 switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system))) | 948 switch (XCODING_SYSTEM_TYPE (Fget_coding_system (coding_system))) |
948 { | 949 { |
949 case CODESYS_AUTODETECT: return Qautodetect; | 950 case CODESYS_AUTODETECT: return Qautomatic_conversion; |
950 case CODESYS_SHIFT_JIS: return Qshift_jis; | 951 case CODESYS_SHIFT_JIS: return Qshift_jis; |
951 case CODESYS_ISO2022: return Qiso2022; | 952 case CODESYS_ISO2022: return Qiso2022; |
952 case CODESYS_BIG5: return Qbig5; | 953 case CODESYS_BIG5: return Qbig5; |
953 case CODESYS_CCL: return Qccl; | 954 case CODESYS_CCL: return Qccl; |
954 case CODESYS_NO_CONVERSION: return Qno_conversion; | 955 case CODESYS_NO_CONVERSION: return Qno_conversion; |
1469 Lstream_rewind (stream); | 1470 Lstream_rewind (stream); |
1470 } | 1471 } |
1471 | 1472 |
1472 DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /* | 1473 DEFUN ("detect-coding-region", Fdetect_coding_region, 2, 3, 0, /* |
1473 Detect coding system of the text in the region between START and END. | 1474 Detect coding system of the text in the region between START and END. |
1474 Returned value is a list of possible coding systems ordered by priority. | 1475 Returned value is a list of possible coding systems ordered by |
1475 If only ASCII characters are found, it returns 'autodetect or one of its | 1476 priority. If only ASCII characters are found, it returns |
1476 subsidiary coding systems according to a detected end-of-line type. | 1477 'automatic-conversion or one of its subsidiary coding systems |
1477 Optional arg BUFFER defaults to the current buffer. | 1478 according to a detected end-of-line type. Optional arg BUFFER |
1479 defaults to the current buffer. | |
1478 */ | 1480 */ |
1479 (start, end, buffer)) | 1481 (start, end, buffer)) |
1480 { | 1482 { |
1481 Lisp_Object val = Qnil; | 1483 Lisp_Object val = Qnil; |
1482 struct buffer *buf = decode_buffer (buffer, 0); | 1484 struct buffer *buf = decode_buffer (buffer, 0); |
1504 break; | 1506 break; |
1505 } | 1507 } |
1506 | 1508 |
1507 if (decst.mask == ~0) | 1509 if (decst.mask == ~0) |
1508 { | 1510 { |
1509 val = subsidiary_coding_system (Fget_coding_system (Qautodetect), | 1511 val = subsidiary_coding_system (Fget_coding_system |
1512 (Qautomatic_conversion), | |
1510 decst.eol_type); | 1513 decst.eol_type); |
1511 } | 1514 } |
1512 else | 1515 else |
1513 { | 1516 { |
1514 int i; | 1517 int i; |
4705 Coding system used for TTY display output. | 4708 Coding system used for TTY display output. |
4706 Not used under a windowing system. | 4709 Not used under a windowing system. |
4707 */ ); | 4710 */ ); |
4708 Vterminal_coding_system = Qnil; | 4711 Vterminal_coding_system = Qnil; |
4709 | 4712 |
4710 DEFVAR_LISP ("process-input-coding-system", &Vprocess_input_coding_system /* | 4713 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read /* |
4711 Default coding system used by C process routines for inputting data. | 4714 Overriding coding system used when writing a file or process. |
4712 This can be changed for a particular process using | 4715 You should *bind* this, not set it. If this is non-nil, it specifies |
4713 `set-process-input-coding-system'. | 4716 the coding system that will be used when a file or process is read |
4717 in, and overrides `buffer-file-coding-system-for-read', | |
4718 `insert-file-contents-pre-hook', etc. Use those variables instead of | |
4719 this one for permanent changes to the environment. | |
4714 */ ); | 4720 */ ); |
4715 Vprocess_input_coding_system = Qnil; | 4721 Vcoding_system_for_read = Qnil; |
4716 | 4722 |
4717 DEFVAR_LISP ("process-output-coding-system", | 4723 DEFVAR_LISP ("coding-system-for-write", |
4718 &Vprocess_output_coding_system /* | 4724 &Vcoding_system_for_write /* |
4719 Default coding system used by C process routines for outputting data. | 4725 Overriding coding system used when writing a file or process. |
4720 This can be changed for a particular process using | 4726 You should *bind* this, not set it. If this is non-nil, it specifies |
4721 `set-process-output-coding-system'. | 4727 the coding system that will be used when a file or process is wrote |
4728 in, and overrides `buffer-file-coding-system', | |
4729 `write-region-pre-hook', etc. Use those variables instead of this one | |
4730 for permanent changes to the environment. | |
4722 */ ); | 4731 */ ); |
4723 Vprocess_output_coding_system = Qnil; | 4732 Vcoding_system_for_write = Qnil; |
4724 | 4733 |
4725 DEFVAR_LISP ("pathname-coding-system", &Vpathname_coding_system /* | 4734 DEFVAR_LISP ("pathname-coding-system", &Vpathname_coding_system /* |
4726 Coding system used to convert pathnames when accessing files. | 4735 Coding system used to convert pathnames when accessing files. |
4727 */ ); | 4736 */ ); |
4728 Vpathname_coding_system = Qnil; | 4737 Vpathname_coding_system = Qnil; |