diff options
| author | Kenichi Handa | 2005-07-29 06:20:30 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-07-29 06:20:30 +0000 |
| commit | 35befdaa753828f2be7b05bcd3052d1db5b2815c (patch) | |
| tree | 5cf0a667f59342ce88e990e28fa0f7406920435f /src/coding.c | |
| parent | 7bebe3ef8acd9592c51b60abfb456d7c26cba625 (diff) | |
| download | emacs-35befdaa753828f2be7b05bcd3052d1db5b2815c.tar.gz emacs-35befdaa753828f2be7b05bcd3052d1db5b2815c.zip | |
(QCascii_compatible_p): New variable.
(syms_of_coding): Initialize it.
(ONE_MORE_BYTE): Decrement `src' before calling string_char.
(ONE_MORE_BYTE_NO_CHECK): Likewise.
(record_conversion_result): Add `default:' case.
(coding_charset_list): Delete unused variable `coding_type'.
(Fdefine_coding_system_internal): Add `ascii-compatible-p'
property in the plist of the coding system.
(Fcoding_system_put): Check QCascii_compatible_p.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c index 8b1d3a6b626..d55817c9c79 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -314,6 +314,7 @@ Lisp_Object Qvalid_codes; | |||
| 314 | Lisp_Object QCcategory, QCmnemonic, QCdefalut_char; | 314 | Lisp_Object QCcategory, QCmnemonic, QCdefalut_char; |
| 315 | Lisp_Object QCdecode_translation_table, QCencode_translation_table; | 315 | Lisp_Object QCdecode_translation_table, QCencode_translation_table; |
| 316 | Lisp_Object QCpost_read_conversion, QCpre_write_conversion; | 316 | Lisp_Object QCpost_read_conversion, QCpre_write_conversion; |
| 317 | Lisp_Object QCascii_compatible_p; | ||
| 317 | 318 | ||
| 318 | extern Lisp_Object Qinsert_file_contents, Qwrite_region; | 319 | extern Lisp_Object Qinsert_file_contents, Qwrite_region; |
| 319 | Lisp_Object Qcall_process, Qcall_process_region; | 320 | Lisp_Object Qcall_process, Qcall_process_region; |
| @@ -706,7 +707,8 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 706 | c = ((c & 1) << 6) | *src++; \ | 707 | c = ((c & 1) << 6) | *src++; \ |
| 707 | else \ | 708 | else \ |
| 708 | { \ | 709 | { \ |
| 709 | c = - string_char (--src, &src, NULL); \ | 710 | src--; \ |
| 711 | c = - string_char (src, &src, NULL); \ | ||
| 710 | record_conversion_result \ | 712 | record_conversion_result \ |
| 711 | (coding, CODING_RESULT_INVALID_SRC); \ | 713 | (coding, CODING_RESULT_INVALID_SRC); \ |
| 712 | } \ | 714 | } \ |
| @@ -724,7 +726,8 @@ static struct coding_system coding_categories[coding_category_max]; | |||
| 724 | c = ((c & 1) << 6) | *src++; \ | 726 | c = ((c & 1) << 6) | *src++; \ |
| 725 | else \ | 727 | else \ |
| 726 | { \ | 728 | { \ |
| 727 | c = - string_char (--src, &src, NULL); \ | 729 | src--; \ |
| 730 | c = - string_char (src, &src, NULL); \ | ||
| 728 | record_conversion_result \ | 731 | record_conversion_result \ |
| 729 | (coding, CODING_RESULT_INVALID_SRC); \ | 732 | (coding, CODING_RESULT_INVALID_SRC); \ |
| 730 | } \ | 733 | } \ |
| @@ -918,6 +921,8 @@ record_conversion_result (struct coding_system *coding, | |||
| 918 | case CODING_RESULT_INSUFFICIENT_MEM: | 921 | case CODING_RESULT_INSUFFICIENT_MEM: |
| 919 | Vlast_code_conversion_error = Qinsufficient_memory; | 922 | Vlast_code_conversion_error = Qinsufficient_memory; |
| 920 | break; | 923 | break; |
| 924 | default: | ||
| 925 | Vlast_code_conversion_error = intern ("Unknown error"); | ||
| 921 | } | 926 | } |
| 922 | } | 927 | } |
| 923 | 928 | ||
| @@ -5091,7 +5096,7 @@ Lisp_Object | |||
| 5091 | coding_charset_list (coding) | 5096 | coding_charset_list (coding) |
| 5092 | struct coding_system *coding; | 5097 | struct coding_system *coding; |
| 5093 | { | 5098 | { |
| 5094 | Lisp_Object attrs, charset_list, coding_type; | 5099 | Lisp_Object attrs, charset_list; |
| 5095 | 5100 | ||
| 5096 | CODING_GET_INFO (coding, attrs, charset_list); | 5101 | CODING_GET_INFO (coding, attrs, charset_list); |
| 5097 | if (EQ (CODING_ATTR_TYPE (attrs), Qiso_2022)) | 5102 | if (EQ (CODING_ATTR_TYPE (attrs), Qiso_2022)) |
| @@ -8871,6 +8876,10 @@ usage: (define-coding-system-internal ...) */) | |||
| 8871 | CODING_ATTR_PLIST (attrs) | 8876 | CODING_ATTR_PLIST (attrs) |
| 8872 | = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category), | 8877 | = Fcons (QCcategory, Fcons (AREF (Vcoding_category_table, category), |
| 8873 | CODING_ATTR_PLIST (attrs))); | 8878 | CODING_ATTR_PLIST (attrs))); |
| 8879 | CODING_ATTR_PLIST (attrs) | ||
| 8880 | = Fcons (QCascii_compatible_p, | ||
| 8881 | Fcons (CODING_ATTR_ASCII_COMPAT (attrs), | ||
| 8882 | CODING_ATTR_PLIST (attrs))); | ||
| 8874 | 8883 | ||
| 8875 | eol_type = args[coding_arg_eol_type]; | 8884 | eol_type = args[coding_arg_eol_type]; |
| 8876 | if (! NILP (eol_type) | 8885 | if (! NILP (eol_type) |
| @@ -8972,6 +8981,10 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put, | |||
| 8972 | CHECK_SYMBOL (val); | 8981 | CHECK_SYMBOL (val); |
| 8973 | CODING_ATTR_PRE_WRITE (attrs) = val; | 8982 | CODING_ATTR_PRE_WRITE (attrs) = val; |
| 8974 | } | 8983 | } |
| 8984 | else if (EQ (prop, QCascii_compatible_p)) | ||
| 8985 | { | ||
| 8986 | CODING_ATTR_ASCII_COMPAT (attrs) = val; | ||
| 8987 | } | ||
| 8975 | 8988 | ||
| 8976 | CODING_ATTR_PLIST (attrs) | 8989 | CODING_ATTR_PLIST (attrs) |
| 8977 | = Fplist_put (CODING_ATTR_PLIST (attrs), prop, val); | 8990 | = Fplist_put (CODING_ATTR_PLIST (attrs), prop, val); |
| @@ -9247,6 +9260,7 @@ syms_of_coding () | |||
| 9247 | DEFSYM (QCencode_translation_table, ":encode-translation-table"); | 9260 | DEFSYM (QCencode_translation_table, ":encode-translation-table"); |
| 9248 | DEFSYM (QCpost_read_conversion, ":post-read-conversion"); | 9261 | DEFSYM (QCpost_read_conversion, ":post-read-conversion"); |
| 9249 | DEFSYM (QCpre_write_conversion, ":pre-write-conversion"); | 9262 | DEFSYM (QCpre_write_conversion, ":pre-write-conversion"); |
| 9263 | DEFSYM (QCascii_compatible_p, ":ascii-compatible-p"); | ||
| 9250 | 9264 | ||
| 9251 | Vcoding_category_table | 9265 | Vcoding_category_table |
| 9252 | = Fmake_vector (make_number (coding_category_max), Qnil); | 9266 | = Fmake_vector (make_number (coding_category_max), Qnil); |
| @@ -9635,7 +9649,7 @@ character."); | |||
| 9635 | plist[3] = args[coding_arg_mnemonic] = make_number ('-'); | 9649 | plist[3] = args[coding_arg_mnemonic] = make_number ('-'); |
| 9636 | plist[5] = args[coding_arg_coding_type] = Qundecided; | 9650 | plist[5] = args[coding_arg_coding_type] = Qundecided; |
| 9637 | /* This is already set. | 9651 | /* This is already set. |
| 9638 | /*plist[7] = args[coding_arg_ascii_compatible_p] = Qt;*/ | 9652 | plist[7] = args[coding_arg_ascii_compatible_p] = Qt; */ |
| 9639 | plist[8] = intern (":charset-list"); | 9653 | plist[8] = intern (":charset-list"); |
| 9640 | plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); | 9654 | plist[9] = args[coding_arg_charset_list] = Fcons (Qascii, Qnil); |
| 9641 | plist[11] = args[coding_arg_for_unibyte] = Qnil; | 9655 | plist[11] = args[coding_arg_for_unibyte] = Qnil; |