# HG changeset patch # User Kenichi Handa # Date 1083156771 0 # Node ID 48af0ea7d387aacd9721d69a3ab5ab9c07e6ab55 # Parent 67cdf44456146f04dab45954a8ee5af4dabed491 (setup_coding_system): Set coding->common_flags correctly for raw-text. (consume_chars): On encoding unibyte text by raw-text, don't check multibyte form. (encode_coding): On encoding by raw-text, never use translation tables. diff -r 67cdf4445614 -r 48af0ea7d387 src/coding.c --- a/src/coding.c Wed Apr 28 12:50:36 2004 +0000 +++ b/src/coding.c Wed Apr 28 12:52:51 2004 +0000 @@ -5093,6 +5093,13 @@ coding->detector = NULL; coding->decoder = decode_coding_raw_text; coding->encoder = encode_coding_raw_text; + if (! EQ (eol_type, Qunix)) + { + coding->common_flags |= CODING_REQUIRE_DECODING_MASK; + if (! VECTORP (eol_type)) + coding->common_flags |= CODING_REQUIRE_ENCODING_MASK; + } + } return; @@ -6381,7 +6388,9 @@ { EMACS_INT bytes; - if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) + if (coding->encoder == encode_coding_raw_text) + c = *src++, pos++; + else if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) c = STRING_CHAR_ADVANCE (src), pos += bytes; else c = BYTE8_TO_CHAR (*src), src++, pos++; @@ -6466,7 +6475,10 @@ int max_lookup; attrs = CODING_ID_ATTRS (coding->id); - translation_table = get_translation_table (attrs, 1, &max_lookup); + if (coding->encoder == encode_coding_raw_text) + translation_table = Qnil, max_lookup = 0; + else + translation_table = get_translation_table (attrs, 1, &max_lookup); if (BUFFERP (coding->dst_object)) {