aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2001-11-19 21:50:44 +0000
committerStefan Monnier2001-11-19 21:50:44 +0000
commit59fac292ee4f5cd5770fe9b9ec7150365e54f502 (patch)
treea7a14a42b1cc22c468d6667a6d8db552ffe638af /src
parent8ae3ef6ea3b19c257f55eff97e8decc19a4d5341 (diff)
downloademacs-59fac292ee4f5cd5770fe9b9ec7150365e54f502.tar.gz
emacs-59fac292ee4f5cd5770fe9b9ec7150365e54f502.zip
(Fwrite_region): Move choose_write_coding_system to after build_annotations.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 93aae5da502..cc1c7a5a33d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4697,12 +4697,7 @@ This does code conversion according to the value of
4697 if (!NILP (start) && !STRINGP (start)) 4697 if (!NILP (start) && !STRINGP (start))
4698 validate_region (&start, &end); 4698 validate_region (&start, &end);
4699 4699
4700 GCPRO4 (start, filename, visit, lockname); 4700 GCPRO5 (start, filename, visit, visit_file, lockname);
4701
4702 /* Decide the coding-system to encode the data with. */
4703 choose_write_coding_system (start, end, filename,
4704 append, visit, lockname, &coding);
4705 Vlast_coding_system_used = coding.symbol;
4706 4701
4707 filename = Fexpand_file_name (filename, Qnil); 4702 filename = Fexpand_file_name (filename, Qnil);
4708 4703
@@ -4713,15 +4708,12 @@ This does code conversion according to the value of
4713 visit_file = Fexpand_file_name (visit, Qnil); 4708 visit_file = Fexpand_file_name (visit, Qnil);
4714 else 4709 else
4715 visit_file = filename; 4710 visit_file = filename;
4716 UNGCPRO;
4717 4711
4718 if (NILP (lockname)) 4712 if (NILP (lockname))
4719 lockname = visit_file; 4713 lockname = visit_file;
4720 4714
4721 annotations = Qnil; 4715 annotations = Qnil;
4722 4716
4723 GCPRO5 (start, filename, annotations, visit_file, lockname);
4724
4725 /* If the file name has special constructs in it, 4717 /* If the file name has special constructs in it,
4726 call the corresponding file handler. */ 4718 call the corresponding file handler. */
4727 handler = Ffind_file_name_handler (filename, Qwrite_region); 4719 handler = Ffind_file_name_handler (filename, Qwrite_region);
@@ -4767,6 +4759,14 @@ This does code conversion according to the value of
4767 4759
4768 GCPRO5 (start, filename, annotations, visit_file, lockname); 4760 GCPRO5 (start, filename, annotations, visit_file, lockname);
4769 4761
4762 /* Decide the coding-system to encode the data with.
4763 We used to make this choice before calling build_annotations, but that
4764 leads to problems when a write-annotate-function takes care of
4765 unsavable chars (as was the case with X-Symbol). */
4766 choose_write_coding_system (start, end, filename,
4767 append, visit, lockname, &coding);
4768 Vlast_coding_system_used = coding.symbol;
4769
4770 given_buffer = current_buffer; 4770 given_buffer = current_buffer;
4771 annotations = build_annotations_2 (start, end, 4771 annotations = build_annotations_2 (start, end,
4772 coding.pre_write_conversion, annotations); 4772 coding.pre_write_conversion, annotations);