diff options
| author | Kenichi Handa <handa@m17n.org> | 2006-04-13 06:47:18 +0000 |
|---|---|---|
| committer | Kenichi Handa <handa@m17n.org> | 2006-04-13 06:47:18 +0000 |
| commit | 6e9715ae06a1e9444e5148af381793430938dc2d (patch) | |
| tree | a487314fb0a4f5af504f74f7d6116c10899bcd10 /src | |
| parent | 73ec0f8900908f70f8b5daafc7f114f6e53a1ae2 (diff) | |
| download | emacs-6e9715ae06a1e9444e5148af381793430938dc2d.tar.gz | |
(setup_coding_system): If eol-type is not yet decided
and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK.
If coding_system is nil, return 0.
(code_convert_region1): Even if coding_system is nil, don't skip
conversion if system_eol_type is not LF.
(code_convert_string1): Likewise.
(code_convert_string_norecord): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/coding.c | 13 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d353e19eabf..02d55e0776f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2006-04-13 Kenichi Handa <handa@m17n.org> + * coding.c (setup_coding_system): If eol-type is not yet decided + and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK. + If coding_system is nil, return 0. + (code_convert_region1): Even if coding_system is nil, don't skip + conversion if system_eol_type is not LF. + (code_convert_string1): Likewise. + (code_convert_string_norecord): Likewise. + +2006-04-13 Kenichi Handa <handa@m17n.org> + * coding.c (setup_coding_system): Fix previous change. (encode_coding): If eol_type is not yet decided, use system_eol_type. diff --git a/src/coding.c b/src/coding.c index ba121df242e..bd96b5cc068 100644 --- a/src/coding.c +++ b/src/coding.c @@ -3607,6 +3607,8 @@ setup_coding_system (coding_system, coding) { coding->eol_type = CODING_EOL_UNDECIDED; coding->common_flags = CODING_REQUIRE_DETECTION_MASK; + if (system_eol_type != CODING_EOL_LF) + coding->common_flags |= CODING_REQUIRE_ENCODING_MASK; } else if (XFASTINT (eol_type) == 1) { @@ -3923,8 +3925,11 @@ setup_coding_system (coding_system, coding) coding->category_idx = CODING_CATEGORY_IDX_BINARY; coding->common_flags = 0; coding->eol_type = NILP (coding_system) ? system_eol_type : CODING_EOL_LF; + if (coding->eol_type != CODING_EOL_LF) + coding->common_flags + |= CODING_REQUIRE_DECODING_MASK | CODING_REQUIRE_ENCODING_MASK; coding->pre_write_conversion = coding->post_read_conversion = Qnil; - return -1; + return NILP (coding_system) ? 0 : -1; } /* Free memory blocks allocated for storing composition information. */ @@ -7113,7 +7118,7 @@ code_convert_region1 (start, end, coding_system, encodep) from = XFASTINT (start); to = XFASTINT (end); - if (NILP (coding_system)) + if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) return make_number (to - from); if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) @@ -7168,7 +7173,7 @@ code_convert_string1 (string, coding_system, nocopy, encodep) CHECK_STRING (string); CHECK_SYMBOL (coding_system); - if (NILP (coding_system)) + if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) return (NILP (nocopy) ? Fcopy_sequence (string) : string); if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) @@ -7227,7 +7232,7 @@ code_convert_string_norecord (string, coding_system, encodep) CHECK_STRING (string); CHECK_SYMBOL (coding_system); - if (NILP (coding_system)) + if (NILP (coding_system) && system_eol_type == CODING_EOL_LF) return string; if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
