aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorGlenn Morris2014-08-10 17:59:34 -0700
committerGlenn Morris2014-08-10 17:59:34 -0700
commitc7367d2de3343e56171c4fe6d439a3ed5f40d06c (patch)
tree54fe9166f6b4320d9518bbac11e2d575a9fda7c2 /src/fileio.c
parent6b7d077506304f440d311fa7b29d210b7a3e121c (diff)
parentf314e84fce8b394da20aa1d69121c74fb34f9a1e (diff)
downloademacs-c7367d2de3343e56171c4fe6d439a3ed5f40d06c.tar.gz
emacs-c7367d2de3343e56171c4fe6d439a3ed5f40d06c.zip
Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.org
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f0bd75b170e..d9c7397c2de 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -323,7 +323,6 @@ static Lisp_Object Qfile_acl;
323static Lisp_Object Qset_file_acl; 323static Lisp_Object Qset_file_acl;
324static Lisp_Object Qfile_newer_than_file_p; 324static Lisp_Object Qfile_newer_than_file_p;
325Lisp_Object Qinsert_file_contents; 325Lisp_Object Qinsert_file_contents;
326static Lisp_Object Qchoose_write_coding_system;
327Lisp_Object Qwrite_region; 326Lisp_Object Qwrite_region;
328static Lisp_Object Qverify_visited_file_modtime; 327static Lisp_Object Qverify_visited_file_modtime;
329static Lisp_Object Qset_visited_file_modtime; 328static Lisp_Object Qset_visited_file_modtime;
@@ -4525,24 +4524,14 @@ build_annotations_unwind (Lisp_Object arg)
4525 4524
4526/* Decide the coding-system to encode the data with. */ 4525/* Decide the coding-system to encode the data with. */
4527 4526
4528DEFUN ("choose-write-coding-system", Fchoose_write_coding_system, 4527static Lisp_Object
4529 Schoose_write_coding_system, 3, 6, 0, 4528choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
4530 doc: /* Choose the coding system for writing a file. 4529 Lisp_Object append, Lisp_Object visit, Lisp_Object lockname,
4531Arguments are as for `write-region'. 4530 struct coding_system *coding)
4532This function is for internal use only. It may prompt the user. */ )
4533 (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
4534 Lisp_Object append, Lisp_Object visit, Lisp_Object lockname)
4535{ 4531{
4536 Lisp_Object val; 4532 Lisp_Object val;
4537 Lisp_Object eol_parent = Qnil; 4533 Lisp_Object eol_parent = Qnil;
4538 4534
4539 /* Mimic write-region behavior. */
4540 if (NILP (start))
4541 {
4542 XSETFASTINT (start, BEGV);
4543 XSETFASTINT (end, ZV);
4544 }
4545
4546 if (auto_saving 4535 if (auto_saving
4547 && NILP (Fstring_equal (BVAR (current_buffer, filename), 4536 && NILP (Fstring_equal (BVAR (current_buffer, filename),
4548 BVAR (current_buffer, auto_save_file_name)))) 4537 BVAR (current_buffer, auto_save_file_name))))
@@ -4635,6 +4624,10 @@ This function is for internal use only. It may prompt the user. */ )
4635 } 4624 }
4636 4625
4637 val = coding_inherit_eol_type (val, eol_parent); 4626 val = coding_inherit_eol_type (val, eol_parent);
4627 setup_coding_system (val, coding);
4628
4629 if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
4630 coding->mode |= CODING_MODE_SELECTIVE_DISPLAY;
4638 return val; 4631 return val;
4639} 4632}
4640 4633
@@ -4803,14 +4796,9 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
4803 We used to make this choice before calling build_annotations, but that 4796 We used to make this choice before calling build_annotations, but that
4804 leads to problems when a write-annotate-function takes care of 4797 leads to problems when a write-annotate-function takes care of
4805 unsavable chars (as was the case with X-Symbol). */ 4798 unsavable chars (as was the case with X-Symbol). */
4806 Vlast_coding_system_used = 4799 Vlast_coding_system_used
4807 Fchoose_write_coding_system (start, end, filename, 4800 = choose_write_coding_system (start, end, filename,
4808 append, visit, lockname); 4801 append, visit, lockname, &coding);
4809
4810 setup_coding_system (Vlast_coding_system_used, &coding);
4811
4812 if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display)))
4813 coding.mode |= CODING_MODE_SELECTIVE_DISPLAY;
4814 4802
4815 if (open_and_close_file && !auto_saving) 4803 if (open_and_close_file && !auto_saving)
4816 { 4804 {
@@ -5829,7 +5817,6 @@ syms_of_fileio (void)
5829 DEFSYM (Qset_file_acl, "set-file-acl"); 5817 DEFSYM (Qset_file_acl, "set-file-acl");
5830 DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p"); 5818 DEFSYM (Qfile_newer_than_file_p, "file-newer-than-file-p");
5831 DEFSYM (Qinsert_file_contents, "insert-file-contents"); 5819 DEFSYM (Qinsert_file_contents, "insert-file-contents");
5832 DEFSYM (Qchoose_write_coding_system, "choose-write-coding-system");
5833 DEFSYM (Qwrite_region, "write-region"); 5820 DEFSYM (Qwrite_region, "write-region");
5834 DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime"); 5821 DEFSYM (Qverify_visited_file_modtime, "verify-visited-file-modtime");
5835 DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime"); 5822 DEFSYM (Qset_visited_file_modtime, "set-visited-file-modtime");
@@ -6068,7 +6055,6 @@ This includes interactive calls to `delete-file' and
6068 defsubr (&Sdefault_file_modes); 6055 defsubr (&Sdefault_file_modes);
6069 defsubr (&Sfile_newer_than_file_p); 6056 defsubr (&Sfile_newer_than_file_p);
6070 defsubr (&Sinsert_file_contents); 6057 defsubr (&Sinsert_file_contents);
6071 defsubr (&Schoose_write_coding_system);
6072 defsubr (&Swrite_region); 6058 defsubr (&Swrite_region);
6073 defsubr (&Scar_less_than_car); 6059 defsubr (&Scar_less_than_car);
6074 defsubr (&Sverify_visited_file_modtime); 6060 defsubr (&Sverify_visited_file_modtime);