From: Kenichi Handa Date: Thu, 29 Jan 2004 01:27:12 +0000 (+0000) Subject: (Finsert_file_contents): Avoid detecting a code twice. X-Git-Tag: emacs-pretest-23.0.90~8295^2~1567 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9a7f80aa9096bc32d0e564ea54ccd5b0efc88e2f;p=emacs.git (Finsert_file_contents): Avoid detecting a code twice. --- diff --git a/src/fileio.c b/src/fileio.c index cb983cc78d4..c5089cbe78d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4415,11 +4415,10 @@ actually used. */) /* Since we are sure that the current buffer was empty before the insertion, we can toggle enable-multibyte-characters directly here without taking - care of marker adjustment and byte combining problem. By - this way, we can run Lisp program safely before decoding - the inserted text. */ + care of marker adjustment. By this way, we can run Lisp + program safely before decoding the inserted text. */ Lisp_Object unwind_data; - int count = SPECPDL_INDEX (); + int count = SPECPDL_INDEX (); unwind_data = Fcons (current_buffer->enable_multibyte_characters, Fcons (current_buffer->undo_list, @@ -4468,15 +4467,7 @@ actually used. */) if (!NILP (visit)) { /* When we visit a file by raw-text, we change the buffer to - unibyte. If we have not yet decided how to decode a text, - decide it at first by detecting the file's encoding. */ - if (CODING_REQUIRE_DETECTION (&coding)) - { - coding_system = detect_coding_system (PT_ADDR, inserted, inserted, - 1, 0, coding_system); - setup_coding_system (coding_system, &coding); - } - + unibyte. */ if (CODING_FOR_UNIBYTE (&coding) /* Can't do this if part of the buffer might be preserved. */ && NILP (replace))