Mercurial > emacs
comparison src/coding.c @ 19118:16ef8c28e4e0
(detect_coding_mask): Include CODING_CATEGORY_MASK_BINARY in the
return value if any 8-bit code is found.
Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 04 Aug 1997 03:01:57 +0000 |
parents | 36b06087dc31 |
children | 8fa6e23f8d22 |
comparison
equal
deleted
inserted
replaced
19117:a187f573752d | 19118:16ef8c28e4e0 |
---|---|
519 | 519 |
520 ---------------------------------------------------------------------- | 520 ---------------------------------------------------------------------- |
521 function control char escape sequence description | 521 function control char escape sequence description |
522 ---------------------------------------------------------------------- | 522 ---------------------------------------------------------------------- |
523 SI (shift-in) 0x0F none invoke G0 to GL | 523 SI (shift-in) 0x0F none invoke G0 to GL |
524 SI (shift-out) 0x0E none invoke G1 to GL | 524 SO (shift-out) 0x0E none invoke G1 to GL |
525 LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL | 525 LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL |
526 LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL | 526 LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL |
527 SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 into GL | 527 SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 into GL |
528 SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 into GL | 528 SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 into GL |
529 ---------------------------------------------------------------------- | 529 ---------------------------------------------------------------------- |
2591 /* C is an ISO2022 specific control code of C1, | 2591 /* C is an ISO2022 specific control code of C1, |
2592 or the first byte of SJIS's 2-byte character code, | 2592 or the first byte of SJIS's 2-byte character code, |
2593 or a leading code of Emacs. */ | 2593 or a leading code of Emacs. */ |
2594 mask = (detect_coding_iso2022 (src, src_end) | 2594 mask = (detect_coding_iso2022 (src, src_end) |
2595 | detect_coding_sjis (src, src_end) | 2595 | detect_coding_sjis (src, src_end) |
2596 | detect_coding_emacs_mule (src, src_end)); | 2596 | detect_coding_emacs_mule (src, src_end) |
2597 | CODING_CATEGORY_MASK_BINARY); | |
2597 | 2598 |
2598 else if (c == ISO_CODE_CSI | 2599 else if (c == ISO_CODE_CSI |
2599 && (src < src_end | 2600 && (src < src_end |
2600 && (*src == ']' | 2601 && (*src == ']' |
2601 || (src + 1 < src_end | 2602 || (src + 1 < src_end |
2602 && src[1] == ']' | 2603 && src[1] == ']' |
2603 && (*src == '0' || *src == '1' || *src == '2'))))) | 2604 && (*src == '0' || *src == '1' || *src == '2'))))) |
2604 /* C is an ISO2022's control-sequence-introducer. */ | 2605 /* C is an ISO2022's control-sequence-introducer. */ |
2605 mask = (detect_coding_iso2022 (src, src_end) | 2606 mask = (detect_coding_iso2022 (src, src_end) |
2606 | detect_coding_sjis (src, src_end) | 2607 | detect_coding_sjis (src, src_end) |
2607 | detect_coding_emacs_mule (src, src_end)); | 2608 | detect_coding_emacs_mule (src, src_end) |
2609 | CODING_CATEGORY_MASK_BINARY); | |
2608 | 2610 |
2609 else if (c < 0xA0) | 2611 else if (c < 0xA0) |
2610 /* C is the first byte of SJIS character code, | 2612 /* C is the first byte of SJIS character code, |
2611 or a leading-code of Emacs. */ | 2613 or a leading-code of Emacs. */ |
2612 mask = (detect_coding_sjis (src, src_end) | 2614 mask = (detect_coding_sjis (src, src_end) |
2613 | detect_coding_emacs_mule (src, src_end)); | 2615 | detect_coding_emacs_mule (src, src_end) |
2616 | CODING_CATEGORY_MASK_BINARY); | |
2614 | 2617 |
2615 else | 2618 else |
2616 /* C is a character of ISO2022 in graphic plane right, | 2619 /* C is a character of ISO2022 in graphic plane right, |
2617 or a SJIS's 1-byte character code (i.e. JISX0201), | 2620 or a SJIS's 1-byte character code (i.e. JISX0201), |
2618 or the first byte of BIG5's 2-byte code. */ | 2621 or the first byte of BIG5's 2-byte code. */ |
2619 mask = (detect_coding_iso2022 (src, src_end) | 2622 mask = (detect_coding_iso2022 (src, src_end) |
2620 | detect_coding_sjis (src, src_end) | 2623 | detect_coding_sjis (src, src_end) |
2621 | detect_coding_big5 (src, src_end)); | 2624 | detect_coding_big5 (src, src_end) |
2625 | CODING_CATEGORY_MASK_BINARY); | |
2622 | 2626 |
2623 return mask; | 2627 return mask; |
2624 } | 2628 } |
2625 | 2629 |
2626 /* Detect how a text of length SRC_BYTES pointed by SRC is encoded. | 2630 /* Detect how a text of length SRC_BYTES pointed by SRC is encoded. |
3799 Vcoding_category_list | 3803 Vcoding_category_list |
3800 = Fcons (coding_category_table[i], Vcoding_category_list); | 3804 = Fcons (coding_category_table[i], Vcoding_category_list); |
3801 } | 3805 } |
3802 | 3806 |
3803 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read, | 3807 DEFVAR_LISP ("coding-system-for-read", &Vcoding_system_for_read, |
3804 "A variable of internal use only.\n\ | 3808 "Specify the coding system for read operations.\n\ |
3809 It is useful to bind this variable with `let', but do not set it globally. | |
3805 If the value is a coding system, it is used for decoding on read operation.\n\ | 3810 If the value is a coding system, it is used for decoding on read operation.\n\ |
3806 If not, an appropriate element is used from one of the coding system alists:\n\ | 3811 If not, an appropriate element is used from one of the coding system alists:\n\ |
3807 There are three of such tables, `file-coding-system-alist',\n\ | 3812 There are three such tables, `file-coding-system-alist',\n\ |
3808 `process-coding-system-alist', and `network-coding-system-alist'."); | 3813 `process-coding-system-alist', and `network-coding-system-alist'."); |
3809 Vcoding_system_for_read = Qnil; | 3814 Vcoding_system_for_read = Qnil; |
3810 | 3815 |
3811 DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write, | 3816 DEFVAR_LISP ("coding-system-for-write", &Vcoding_system_for_write, |
3812 "A variable of internal use only.\n\ | 3817 "Specify the coding system for write operations.\n\ |
3818 It is useful to bind this variable with `let', but do not set it globally. | |
3813 If the value is a coding system, it is used for encoding on write operation.\n\ | 3819 If the value is a coding system, it is used for encoding on write operation.\n\ |
3814 If not, an appropriate element is used from one of the coding system alists:\n\ | 3820 If not, an appropriate element is used from one of the coding system alists:\n\ |
3815 There are three of such tables, `file-coding-system-alist',\n\ | 3821 There are three such tables, `file-coding-system-alist',\n\ |
3816 `process-coding-system-alist', and `network-coding-system-alist'."); | 3822 `process-coding-system-alist', and `network-coding-system-alist'."); |
3817 Vcoding_system_for_write = Qnil; | 3823 Vcoding_system_for_write = Qnil; |
3818 | 3824 |
3819 DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used, | 3825 DEFVAR_LISP ("last-coding-system-used", &Vlast_coding_system_used, |
3820 "Coding system used in the latest file or process I/O."); | 3826 "Coding system used in the latest file or process I/O."); |