aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 143148193a4..3a0b65d1181 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3746,8 +3746,8 @@ build_annotations_unwind (buf)
3746 return Qnil; 3746 return Qnil;
3747} 3747}
3748 3748
3749DEFUN ("write-region", Fwrite_region, Swrite_region, 3, 7, 3749DEFUN ("write-region", Fwrite_region, Swrite_region, 3, 6,
3750 "r\nFWrite region to file: \ni\ni\ni\nZCoding system: ", 3750 "r\nFWrite region to file: ",
3751 "Write current region into specified file.\n\ 3751 "Write current region into specified file.\n\
3752When called from a program, takes three arguments:\n\ 3752When called from a program, takes three arguments:\n\
3753START, END and FILENAME. START and END are buffer positions.\n\ 3753START, END and FILENAME. START and END are buffer positions.\n\
@@ -3762,18 +3762,10 @@ If VISIT is a string, it is a second file name;\n\
3762If VISIT is neither t nor nil nor a string,\n\ 3762If VISIT is neither t nor nil nor a string,\n\
3763 that means do not print the \"Wrote file\" message.\n\ 3763 that means do not print the \"Wrote file\" message.\n\
3764The optional sixth arg LOCKNAME, if non-nil, specifies the name to\n\ 3764The optional sixth arg LOCKNAME, if non-nil, specifies the name to\n\
3765 use for locking and unlocking, overriding FILENAME and VISIT.\n\
3766The optional seventh arg CODING-SYSTEM, if non-nil, specifies the coding\n\
3767 system to be used for encoding characters. For interactive use,\n\
3768 you can specify it by giving a prefix argument. If no coding system\n\
3769 is specified, the current region is encoded according to the value of\n\
3770 `coding-system-for-write' or `coding-system-alist'. The variable\n\
3771 `last-coding-system-used' is set the coding system actually used.\n\
3772Kludgy feature: if START is a string, then that string is written\n\ 3765Kludgy feature: if START is a string, then that string is written\n\
3773to the file, instead of any buffer contents, and END is ignored.") 3766to the file, instead of any buffer contents, and END is ignored.")
3774 (start, end, filename, append, visit, lockname, coding_system_symbol) 3767 (start, end, filename, append, visit, lockname)
3775 Lisp_Object start, end, filename, append, visit, lockname; 3768 Lisp_Object start, end, filename, append, visit, lockname;
3776 Lisp_Object coding_system_symbol;
3777{ 3769{
3778 register int desc; 3770 register int desc;
3779 int failure; 3771 int failure;
@@ -3804,7 +3796,7 @@ to the file, instead of any buffer contents, and END is ignored.")
3804 if (!NILP (start) && !STRINGP (start)) 3796 if (!NILP (start) && !STRINGP (start))
3805 validate_region (&start, &end); 3797 validate_region (&start, &end);
3806 3798
3807 GCPRO5 (start, filename, visit, lockname, coding_system_symbol); 3799 GCPRO4 (start, filename, visit, lockname);
3808 3800
3809 /* Decide the coding-system to be encoded to. */ 3801 /* Decide the coding-system to be encoded to. */
3810 { 3802 {
@@ -3812,8 +3804,6 @@ to the file, instead of any buffer contents, and END is ignored.")
3812 3804
3813 if (auto_saving || NILP (current_buffer->enable_multibyte_characters)) 3805 if (auto_saving || NILP (current_buffer->enable_multibyte_characters))
3814 val = Qnil; 3806 val = Qnil;
3815 else if (!NILP (coding_system_symbol))
3816 val = coding_system_symbol;
3817 else if (!NILP (Vcoding_system_for_write)) 3807 else if (!NILP (Vcoding_system_for_write))
3818 val = Vcoding_system_for_write; 3808 val = Vcoding_system_for_write;
3819 else if (!NILP (Flocal_variable_if_set_p (Qbuffer_file_coding_system, 3809 else if (!NILP (Flocal_variable_if_set_p (Qbuffer_file_coding_system,
@@ -3829,7 +3819,7 @@ to the file, instead of any buffer contents, and END is ignored.")
3829 coding_systems = Ffind_coding_system (7, args); 3819 coding_systems = Ffind_coding_system (7, args);
3830 val = (CONSP (coding_systems) 3820 val = (CONSP (coding_systems)
3831 ? XCONS (coding_systems)->cdr 3821 ? XCONS (coding_systems)->cdr
3832 : Fsymbol_value (Qbuffer_file_coding_system)); 3822 : current_buffer->buffer_file_coding_system);
3833 } 3823 }
3834 setup_coding_system (Fcheck_coding_system (val), &coding); 3824 setup_coding_system (Fcheck_coding_system (val), &coding);
3835 if (!STRINGP (start) && !NILP (current_buffer->selective_display)) 3825 if (!STRINGP (start) && !NILP (current_buffer->selective_display))
@@ -4457,7 +4447,7 @@ auto_save_1 ()
4457 return 4447 return
4458 Fwrite_region (Qnil, Qnil, 4448 Fwrite_region (Qnil, Qnil,
4459 current_buffer->auto_save_file_name, 4449 current_buffer->auto_save_file_name,
4460 Qnil, Qlambda, Qnil, Qnil); 4450 Qnil, Qlambda, Qnil);
4461} 4451}
4462 4452
4463static Lisp_Object 4453static Lisp_Object