From: Richard M. Stallman Date: Tue, 12 May 1998 23:10:15 +0000 (+0000) Subject: (Finsert_file_contents): Don't use the fast replace code X-Git-Tag: emacs-20.3~1035 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=70697733d43aa570748c3a59cc818d8681543b08;p=emacs.git (Finsert_file_contents): Don't use the fast replace code if coding needs eol conversion. (Finsert_file_contents) [DOS_NT]: When setting buffer_file_type, if code conversion is needed, file is not binary. --- diff --git a/src/fileio.c b/src/fileio.c index 046ac725871..f9e0b93c73f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3453,7 +3453,9 @@ This does code conversion according to the value of\n\ But if we discover the need for conversion, we give up on this method and let the following if-statement handle the replace job. */ if (!NILP (replace) - && ! CODING_REQUIRE_DECODING (&coding)) + && ! CODING_REQUIRE_DECODING (&coding) + && (coding.eol_type == CODING_EOL_UNDECIDED + || coding.eol_type == CODING_EOL_LF)) { /* same_at_start and same_at_end count bytes, because file access counts bytes @@ -3912,11 +3914,12 @@ This does code conversion according to the value of\n\ /* Use the conversion type to determine buffer-file-type (find-buffer-file-type is now used to help determine the conversion). */ - if (coding.eol_type != CODING_EOL_UNDECIDED - && coding.eol_type != CODING_EOL_LF) - current_buffer->buffer_file_type = Qnil; - else + if ((coding.eol_type == CODING_EOL_UNDECIDED + || coding.eol_type == CODING_EOL_LF) + && ! CODING_REQUIRE_DECODING (&coding)) current_buffer->buffer_file_type = Qt; + else + current_buffer->buffer_file_type = Qnil; #endif }