aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-08-21 12:49:41 +0000
committerKenichi Handa2006-08-21 12:49:41 +0000
commit75421805fdc89b09743c9def0cfcc4e84b69ac4f (patch)
tree88e9d030ed847b89abdaa11020fee18eb04d8c95 /src
parent4a015c451a11c67ae830d2107c8b77052cb2d158 (diff)
downloademacs-75421805fdc89b09743c9def0cfcc4e84b69ac4f.tar.gz
emacs-75421805fdc89b09743c9def0cfcc4e84b69ac4f.zip
(Finsert_file_contents): On recovering a file, assume
Unix-like eol. (choose_write_coding_system): On auto-saving a file, force Unix-like eol.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c
index a8408927f5c..bfef8756e01 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3917,7 +3917,7 @@ actually used. */)
3917 3917
3918 if (EQ (Vcoding_system_for_read, Qauto_save_coding)) 3918 if (EQ (Vcoding_system_for_read, Qauto_save_coding))
3919 { 3919 {
3920 coding_system = Qutf_8_emacs; 3920 coding_system = coding_inherit_eol_type (Qutf_8_emacs, Qunix);
3921 setup_coding_system (coding_system, &coding); 3921 setup_coding_system (coding_system, &coding);
3922 /* Ensure we set Vlast_coding_system_used. */ 3922 /* Ensure we set Vlast_coding_system_used. */
3923 set_coding_system = 1; 3923 set_coding_system = 1;
@@ -4806,11 +4806,15 @@ choose_write_coding_system (start, end, filename,
4806 struct coding_system *coding; 4806 struct coding_system *coding;
4807{ 4807{
4808 Lisp_Object val; 4808 Lisp_Object val;
4809 Lisp_Object eol_parent = Qnil;
4809 4810
4810 if (auto_saving 4811 if (auto_saving
4811 && NILP (Fstring_equal (current_buffer->filename, 4812 && NILP (Fstring_equal (current_buffer->filename,
4812 current_buffer->auto_save_file_name))) 4813 current_buffer->auto_save_file_name)))
4813 val = Qutf_8_emacs; 4814 {
4815 val = Qutf_8_emacs;
4816 eol_parent = Qunix;
4817 }
4814 else if (!NILP (Vcoding_system_for_write)) 4818 else if (!NILP (Vcoding_system_for_write))
4815 { 4819 {
4816 val = Vcoding_system_for_write; 4820 val = Vcoding_system_for_write;
@@ -4895,7 +4899,7 @@ choose_write_coding_system (start, end, filename,
4895 val = raw_text_coding_system (val); 4899 val = raw_text_coding_system (val);
4896 } 4900 }
4897 4901
4898 val = coding_inherit_eol_type (val, Qnil); 4902 val = coding_inherit_eol_type (val, eol_parent);
4899 setup_coding_system (val, coding); 4903 setup_coding_system (val, coding);
4900 4904
4901 if (!STRINGP (start) && !NILP (current_buffer->selective_display)) 4905 if (!STRINGP (start) && !NILP (current_buffer->selective_display))