aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 65aaf572fd7..15bebdf09fa 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4593,17 +4593,26 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file
4593 4593
4594 if (!force_raw_text 4594 if (!force_raw_text
4595 && !NILP (Ffboundp (Vselect_safe_coding_system_function))) 4595 && !NILP (Ffboundp (Vselect_safe_coding_system_function)))
4596 /* Confirm that VAL can surely encode the current region. */ 4596 {
4597 val = call5 (Vselect_safe_coding_system_function, 4597 /* Confirm that VAL can surely encode the current region. */
4598 start, end, val, Qnil, filename); 4598 val = call5 (Vselect_safe_coding_system_function,
4599 start, end, val, Qnil, filename);
4600 CHECK_CODING_SYSTEM (val);
4601 }
4599 4602
4600 /* If the decided coding-system doesn't specify end-of-line 4603 /* If the decided coding-system doesn't specify end-of-line
4601 format, we use that of 4604 format, we use that of
4602 `default-buffer-file-coding-system'. */ 4605 `default-buffer-file-coding-system'. */
4603 if (! using_default_coding 4606 if (! using_default_coding)
4604 && ! NILP (BVAR (&buffer_defaults, buffer_file_coding_system))) 4607 {
4605 val = (coding_inherit_eol_type 4608 Lisp_Object dflt = BVAR (&buffer_defaults, buffer_file_coding_system);
4606 (val, BVAR (&buffer_defaults, buffer_file_coding_system))); 4609
4610 if (! NILP (dflt))
4611 {
4612 CHECK_CODING_SYSTEM (dflt);
4613 val = (coding_inherit_eol_type (val, dflt));
4614 }
4615 }
4607 4616
4608 /* If we decide not to encode text, use `raw-text' or one of its 4617 /* If we decide not to encode text, use `raw-text' or one of its
4609 subsidiaries. */ 4618 subsidiaries. */