diff options
author | Richard M. Stallman <[email protected]> | 1997-07-08 11:37:32 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1997-07-08 11:37:32 +0000 |
commit | 71312b68cf84689ecc8d2d1eaca314143e5b0205 (patch) | |
tree | d44ca7fe7abbeea2af8b0601b95d28c20061ce6b /src | |
parent | e2d8d746dec658fe4637182b86fb5c401bf89dd2 (diff) |
(Finsert_file_contents): Give up match-end only if
coding requires conversion. Adjust end of non-matching text area
to multibyte character boundary if enable_multibyte_character is non-nil.
Diffstat (limited to 'src')
-rw-r--r-- | src/fileio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index 1526015921..5d9352ed75 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3291,7 +3291,8 @@ This does code conversion according to the value of\n\ we cannot use this method; giveup and try the other. */ if (same_at_end > same_at_start && FETCH_BYTE (same_at_end - 1) >= 0200 - && ! NILP (current_buffer->enable_multibyte_characters)) + && ! NILP (current_buffer->enable_multibyte_characters) + && CODING_REQUIRE_CONVERSION (&coding)) giveup_match_end = 1; break; } @@ -3302,6 +3303,12 @@ This does code conversion according to the value of\n\ { /* We win! We can handle REPLACE the optimized way. */ + /* Extends the end of non-matching text area to multibyte + character boundary. */ + if (! NILP (current_buffer->enable_multibyte_characters)) + while (same_at_end < ZV && ! CHAR_HEAD_P (POS_ADDR (same_at_end))) + same_at_end++; + /* Don't try to reuse the same piece of text twice. */ overlap = same_at_start - BEGV - (same_at_end + st.st_size - ZV); if (overlap > 0) |