Commit 87e3d54c authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Finsert_file_contents): Call Fcheck_coding_system

before calling setup_coding_system so that autoloading of a coding
system work.
parent ac249c4c
...@@ -4503,12 +4503,12 @@ actually used. */) ...@@ -4503,12 +4503,12 @@ actually used. */)
this way, we can run Lisp program safely before decoding this way, we can run Lisp program safely before decoding
the inserted text. */ the inserted text. */
Lisp_Object unwind_data; Lisp_Object unwind_data;
int count = SPECPDL_INDEX (); int count = SPECPDL_INDEX ();
unwind_data = Fcons (current_buffer->enable_multibyte_characters, unwind_data = Fcons (current_buffer->enable_multibyte_characters,
Fcons (current_buffer->undo_list, Fcons (current_buffer->undo_list,
Fcurrent_buffer ())); Fcurrent_buffer ()));
current_buffer->enable_multibyte_characters = Qnil; current_buffer->enable_multibyte_characters = Qnil;
current_buffer->undo_list = Qt; current_buffer->undo_list = Qt;
record_unwind_protect (decide_coding_unwind, unwind_data); record_unwind_protect (decide_coding_unwind, unwind_data);
...@@ -4530,7 +4530,6 @@ actually used. */) ...@@ -4530,7 +4530,6 @@ actually used. */)
if (CONSP (coding_systems)) if (CONSP (coding_systems))
val = XCAR (coding_systems); val = XCAR (coding_systems);
} }
unbind_to (count, Qnil); unbind_to (count, Qnil);
inserted = Z_BYTE - BEG_BYTE; inserted = Z_BYTE - BEG_BYTE;
} }
...@@ -4541,7 +4540,7 @@ actually used. */) ...@@ -4541,7 +4540,7 @@ actually used. */)
on some system. */ on some system. */
{ {
struct coding_system temp_coding; struct coding_system temp_coding;
setup_coding_system (val, &temp_coding); setup_coding_system (Fcheck_coding_system (val), &temp_coding);
bcopy (&temp_coding, &coding, sizeof coding); bcopy (&temp_coding, &coding, sizeof coding);
} }
/* Ensure we set Vlast_coding_system_used. */ /* Ensure we set Vlast_coding_system_used. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment