From 75421805fdc89b09743c9def0cfcc4e84b69ac4f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 21 Aug 2006 12:49:41 +0000 Subject: [PATCH] (Finsert_file_contents): On recovering a file, assume Unix-like eol. (choose_write_coding_system): On auto-saving a file, force Unix-like eol. --- src/fileio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index a8408927f5..bfef8756e0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3917,7 +3917,7 @@ actually used. */) if (EQ (Vcoding_system_for_read, Qauto_save_coding)) { - coding_system = Qutf_8_emacs; + coding_system = coding_inherit_eol_type (Qutf_8_emacs, Qunix); setup_coding_system (coding_system, &coding); /* Ensure we set Vlast_coding_system_used. */ set_coding_system = 1; @@ -4806,11 +4806,15 @@ choose_write_coding_system (start, end, filename, struct coding_system *coding; { Lisp_Object val; + Lisp_Object eol_parent = Qnil; if (auto_saving && NILP (Fstring_equal (current_buffer->filename, current_buffer->auto_save_file_name))) - val = Qutf_8_emacs; + { + val = Qutf_8_emacs; + eol_parent = Qunix; + } else if (!NILP (Vcoding_system_for_write)) { val = Vcoding_system_for_write; @@ -4895,7 +4899,7 @@ choose_write_coding_system (start, end, filename, val = raw_text_coding_system (val); } - val = coding_inherit_eol_type (val, Qnil); + val = coding_inherit_eol_type (val, eol_parent); setup_coding_system (val, coding); if (!STRINGP (start) && !NILP (current_buffer->selective_display)) -- 2.39.2