aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2004-04-28 12:52:51 +0000
committerKenichi Handa2004-04-28 12:52:51 +0000
commitea29edf2919e002e5413e83566e393bea084ac33 (patch)
tree5c0adca399edeca764fdc4bc80558f0336c9a7f9 /src/coding.c
parent55961e9e461b43cfb7b30ae52023a88da54cf3fd (diff)
downloademacs-ea29edf2919e002e5413e83566e393bea084ac33.tar.gz
emacs-ea29edf2919e002e5413e83566e393bea084ac33.zip
(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.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index b4c767c85ba..d618f4d4497 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5093,6 +5093,13 @@ setup_coding_system (coding_system, coding)
5093 coding->detector = NULL; 5093 coding->detector = NULL;
5094 coding->decoder = decode_coding_raw_text; 5094 coding->decoder = decode_coding_raw_text;
5095 coding->encoder = encode_coding_raw_text; 5095 coding->encoder = encode_coding_raw_text;
5096 if (! EQ (eol_type, Qunix))
5097 {
5098 coding->common_flags |= CODING_REQUIRE_DECODING_MASK;
5099 if (! VECTORP (eol_type))
5100 coding->common_flags |= CODING_REQUIRE_ENCODING_MASK;
5101 }
5102
5096 } 5103 }
5097 5104
5098 return; 5105 return;
@@ -6381,7 +6388,9 @@ consume_chars (coding, translation_table, max_lookup)
6381 { 6388 {
6382 EMACS_INT bytes; 6389 EMACS_INT bytes;
6383 6390
6384 if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0) 6391 if (coding->encoder == encode_coding_raw_text)
6392 c = *src++, pos++;
6393 else if ((bytes = MULTIBYTE_LENGTH (src, src_end)) > 0)
6385 c = STRING_CHAR_ADVANCE (src), pos += bytes; 6394 c = STRING_CHAR_ADVANCE (src), pos += bytes;
6386 else 6395 else
6387 c = BYTE8_TO_CHAR (*src), src++, pos++; 6396 c = BYTE8_TO_CHAR (*src), src++, pos++;
@@ -6466,7 +6475,10 @@ encode_coding (coding)
6466 int max_lookup; 6475 int max_lookup;
6467 6476
6468 attrs = CODING_ID_ATTRS (coding->id); 6477 attrs = CODING_ID_ATTRS (coding->id);
6469 translation_table = get_translation_table (attrs, 1, &max_lookup); 6478 if (coding->encoder == encode_coding_raw_text)
6479 translation_table = Qnil, max_lookup = 0;
6480 else
6481 translation_table = get_translation_table (attrs, 1, &max_lookup);
6470 6482
6471 if (BUFFERP (coding->dst_object)) 6483 if (BUFFERP (coding->dst_object))
6472 { 6484 {