+ notfound:
+
+ if (! coding_system_decided)
+ {
+ /* The coding system is not yet decided. Decide it by an
+ optimized method for handling `coding:' tag.
+
+ Note that we can get here only if the buffer was empty
+ before the insertion. */
+ Lisp_Object val;
+ val = Qnil;
+
+ if (!NILP (Vcoding_system_for_read))
+ val = Vcoding_system_for_read;
+ else
+ {
+ /* 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. */
+ Lisp_Object unwind_data;
+ int count = specpdl_ptr - specpdl;
+
+ unwind_data = Fcons (current_buffer->enable_multibyte_characters,
+ Fcons (current_buffer->undo_list,
+ Fcurrent_buffer ()));
+ current_buffer->enable_multibyte_characters = Qnil;
+ current_buffer->undo_list = Qt;
+ record_unwind_protect (decide_coding_unwind, unwind_data);
+
+ if (inserted > 0 && ! NILP (Vset_auto_coding_function))
+ {
+ val = call2 (Vset_auto_coding_function,
+ filename, make_number (inserted));
+ }
+
+ if (NILP (val))
+ {
+ /* If the coding system is not yet decided, check
+ file-coding-system-alist. */
+ Lisp_Object args[6], coding_systems;
+
+ args[0] = Qinsert_file_contents, args[1] = orig_filename;
+ args[2] = visit, args[3] = beg, args[4] = end, args[5] = Qnil;
+ coding_systems = Ffind_operation_coding_system (6, args);
+ if (CONSP (coding_systems))
+ val = XCAR (coding_systems);
+ }
+
+ unbind_to (count, Qnil);
+ inserted = Z_BYTE - BEG_BYTE;
+ }
+
+ /* The following kludgy code is to avoid some compiler bug.
+ We can't simply do
+ setup_coding_system (val, &coding);
+ on some system. */
+ {
+ struct coding_system temp_coding;
+ setup_coding_system (val, &temp_coding);
+ bcopy (&temp_coding, &coding, sizeof coding);
+ }
+ /* Ensure we set Vlast_coding_system_used. */
+ set_coding_system = 1;
+
+ if (NILP (current_buffer->enable_multibyte_characters)
+ && ! NILP (val))
+ /* We must suppress all character code conversion except for
+ end-of-line conversion. */
+ setup_raw_text_coding_system (&coding);
+ coding.src_multibyte = 0;
+ coding.dst_multibyte
+ = !NILP (current_buffer->enable_multibyte_characters);
+ }
+
+ if (!NILP (visit)
+ && (coding.type == coding_type_no_conversion
+ || coding.type == coding_type_raw_text))
+ {
+ /* Visiting a file with these coding system always make the buffer
+ unibyte. */
+ current_buffer->enable_multibyte_characters = Qnil;
+ coding.dst_multibyte = 0;
+ }
+
+ if (inserted > 0 || coding.type == coding_type_ccl)