Mercurial > emacs
comparison src/coding.c @ 88856:13a375bc220d
(ENCODE_DESIGNATION, decode_eol)
(make_conversion_work_buffer, code_conversion_restore)
(Fdefine_coding_system_internal): Convert Lisp types.
(code_conversion_restore): Use EQ, not ==.
(Fencode_coding_string): Fix code_convert_string call.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 16 Jul 2002 15:10:13 +0000 |
parents | 64b8f6168269 |
children | 108e2535280d |
comparison
equal
deleted
inserted
replaced
88855:0382604a03ea | 88856:13a375bc220d |
---|---|
3122 char *intermediate_char_96 = ",-./"; \ | 3122 char *intermediate_char_96 = ",-./"; \ |
3123 int revision = -1; \ | 3123 int revision = -1; \ |
3124 int c; \ | 3124 int c; \ |
3125 \ | 3125 \ |
3126 if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \ | 3126 if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_REVISION) \ |
3127 revision = XINT (CHARSET_ISO_REVISION (charset)); \ | 3127 revision = CHARSET_ISO_REVISION (charset); \ |
3128 \ | 3128 \ |
3129 if (revision >= 0) \ | 3129 if (revision >= 0) \ |
3130 { \ | 3130 { \ |
3131 EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '&'); \ | 3131 EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '&'); \ |
3132 EMIT_ONE_BYTE ('@' + revision); \ | 3132 EMIT_ONE_BYTE ('@' + revision); \ |
5126 | 5126 |
5127 move_gap_both (coding->dst_pos + coding->produced_char, | 5127 move_gap_both (coding->dst_pos + coding->produced_char, |
5128 coding->dst_pos_byte + coding->produced); | 5128 coding->dst_pos_byte + coding->produced); |
5129 undo_list = current_buffer->undo_list; | 5129 undo_list = current_buffer->undo_list; |
5130 current_buffer->undo_list = Qt; | 5130 current_buffer->undo_list = Qt; |
5131 del_range_2 (coding->dst_pos, coding->dst_pos_byte, GPT, GPT_BYTE, Qnil); | 5131 del_range_2 (coding->dst_pos, coding->dst_pos_byte, GPT, GPT_BYTE, 0); |
5132 current_buffer->undo_list = undo_list; | 5132 current_buffer->undo_list = undo_list; |
5133 pbeg = GPT_ADDR; | 5133 pbeg = GPT_ADDR; |
5134 pend = pbeg + coding->produced; | 5134 pend = pbeg + coding->produced; |
5135 | 5135 |
5136 for (p = pend - 1; p >= pbeg; p--) | 5136 for (p = pend - 1; p >= pbeg; p--) |
5781 Vcode_conversion_work_buf_list | 5781 Vcode_conversion_work_buf_list |
5782 = Fcons (Vcode_conversion_reused_work_buf, Qnil); | 5782 = Fcons (Vcode_conversion_reused_work_buf, Qnil); |
5783 } | 5783 } |
5784 else | 5784 else |
5785 { | 5785 { |
5786 int depth = Flength (Vcode_conversion_work_buf_list); | 5786 int depth = XINT (Flength (Vcode_conversion_work_buf_list)); |
5787 char str[128]; | 5787 char str[128]; |
5788 | 5788 |
5789 sprintf (str, " *code-conversion-work*<%d>", depth); | 5789 sprintf (str, " *code-conversion-work*<%d>", depth); |
5790 Vcode_conversion_work_buf_list | 5790 Vcode_conversion_work_buf_list |
5791 = Fcons (Fget_buffer_create (build_string (str)), | 5791 = Fcons (Fget_buffer_create (build_string (str)), |
5805 | 5805 |
5806 Lisp_Object | 5806 Lisp_Object |
5807 code_conversion_restore (info) | 5807 code_conversion_restore (info) |
5808 Lisp_Object info; | 5808 Lisp_Object info; |
5809 { | 5809 { |
5810 int depth = Flength (Vcode_conversion_work_buf_list); | 5810 int depth = XINT (Flength (Vcode_conversion_work_buf_list)); |
5811 Lisp_Object buf; | 5811 Lisp_Object buf; |
5812 | 5812 |
5813 if (depth > 0) | 5813 if (depth > 0) |
5814 { | 5814 { |
5815 buf = XCAR (Vcode_conversion_work_buf_list); | 5815 buf = XCAR (Vcode_conversion_work_buf_list); |
5816 Vcode_conversion_work_buf_list = XCDR (Vcode_conversion_work_buf_list); | 5816 Vcode_conversion_work_buf_list = XCDR (Vcode_conversion_work_buf_list); |
5817 if (depth > 1 && !NILP (Fbuffer_live_p (buf))) | 5817 if (depth > 1 && !NILP (Fbuffer_live_p (buf))) |
5818 Fkill_buffer (buf); | 5818 Fkill_buffer (buf); |
5819 } | 5819 } |
5820 | 5820 |
5821 if (saved_coding->dst_object == Qt | 5821 if (EQ (saved_coding->dst_object, Qt) |
5822 && saved_coding->destination) | 5822 && saved_coding->destination) |
5823 xfree (saved_coding->destination); | 5823 xfree (saved_coding->destination); |
5824 | 5824 |
5825 return save_excursion_restore (info); | 5825 return save_excursion_restore (info); |
5826 } | 5826 } |
6876 not fully specified.) */) | 6876 not fully specified.) */) |
6877 (string, coding_system, nocopy, buffer) | 6877 (string, coding_system, nocopy, buffer) |
6878 Lisp_Object string, coding_system, nocopy, buffer; | 6878 Lisp_Object string, coding_system, nocopy, buffer; |
6879 { | 6879 { |
6880 return code_convert_string (string, coding_system, buffer, | 6880 return code_convert_string (string, coding_system, buffer, |
6881 nocopy, ! NILP (nocopy), 1); | 6881 1, ! NILP (nocopy), 1); |
6882 } | 6882 } |
6883 | 6883 |
6884 | 6884 |
6885 DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, | 6885 DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0, |
6886 doc: /* Decode a Japanese character which has CODE in shift_jis encoding. | 6886 doc: /* Decode a Japanese character which has CODE in shift_jis encoding. |
7491 valids = Fmake_string (make_number (256), make_number (0)); | 7491 valids = Fmake_string (make_number (256), make_number (0)); |
7492 for (tail = val; !NILP (tail); tail = Fcdr (tail)) | 7492 for (tail = val; !NILP (tail); tail = Fcdr (tail)) |
7493 { | 7493 { |
7494 val = Fcar (tail); | 7494 val = Fcar (tail); |
7495 if (INTEGERP (val)) | 7495 if (INTEGERP (val)) |
7496 ASET (valids, XINT (val), 1); | 7496 ASET (valids, XINT (val), make_number (1)); |
7497 else | 7497 else |
7498 { | 7498 { |
7499 int from, to; | 7499 int from, to; |
7500 | 7500 |
7501 CHECK_CONS (val); | 7501 CHECK_CONS (val); |
7502 CHECK_NUMBER (XCAR (val)); | 7502 CHECK_NUMBER (XCAR (val)); |
7503 CHECK_NUMBER (XCDR (val)); | 7503 CHECK_NUMBER (XCDR (val)); |
7504 from = XINT (XCAR (val)); | 7504 from = XINT (XCAR (val)); |
7505 to = XINT (XCDR (val)); | 7505 to = XINT (XCDR (val)); |
7506 for (i = from; i <= to; i++) | 7506 for (i = from; i <= to; i++) |
7507 ASET (valids, i, 1); | 7507 ASET (valids, i, make_number (1)); |
7508 } | 7508 } |
7509 } | 7509 } |
7510 ASET (attrs, coding_attr_ccl_valids, valids); | 7510 ASET (attrs, coding_attr_ccl_valids, valids); |
7511 | 7511 |
7512 category = coding_category_ccl; | 7512 category = coding_category_ccl; |