diff options
| author | Stefan Monnier | 2001-11-17 01:24:01 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-17 01:24:01 +0000 |
| commit | 236a12f2d97e7ef5b66764f2d9fb3926d2c5304a (patch) | |
| tree | a94a1f2684fe24b63ebb7570ee1d5034bd21585f /src | |
| parent | e071f64ec4c90967c1803319fa30e5d47b3b9267 (diff) | |
| download | emacs-236a12f2d97e7ef5b66764f2d9fb3926d2c5304a.tar.gz emacs-236a12f2d97e7ef5b66764f2d9fb3926d2c5304a.zip | |
(build_annotations): Split off the tail.
(build_annotations_2): New fun. Extracted from build_annotations.
(Fwrite_region): Split the call to build_annotations into two
calls to build_annotations and build_annotations_2.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/fileio.c b/src/fileio.c index 8e4ee22f2cc..9f7c72e2221 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4511,8 +4511,9 @@ actually used. */) | |||
| 4511 | RETURN_UNGCPRO (unbind_to (count, val)); | 4511 | RETURN_UNGCPRO (unbind_to (count, val)); |
| 4512 | } | 4512 | } |
| 4513 | 4513 | ||
| 4514 | static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object, | 4514 | static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object)); |
| 4515 | Lisp_Object)); | 4515 | static Lisp_Object build_annotations_2 P_ ((Lisp_Object, Lisp_Object, |
| 4516 | Lisp_Object, Lisp_Object)); | ||
| 4516 | 4517 | ||
| 4517 | /* If build_annotations switched buffers, switch back to BUF. | 4518 | /* If build_annotations switched buffers, switch back to BUF. |
| 4518 | Kill the temporary buffer that was selected in the meantime. | 4519 | Kill the temporary buffer that was selected in the meantime. |
| @@ -4705,7 +4706,7 @@ This does code conversion according to the value of | |||
| 4705 | 4706 | ||
| 4706 | filename = Fexpand_file_name (filename, Qnil); | 4707 | filename = Fexpand_file_name (filename, Qnil); |
| 4707 | 4708 | ||
| 4708 | if (! NILP (mustbenew) && !EQ (mustbenew, Qexcl)) | 4709 | if (!NILP (mustbenew) && !EQ (mustbenew, Qexcl)) |
| 4709 | barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); | 4710 | barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); |
| 4710 | 4711 | ||
| 4711 | if (STRINGP (visit)) | 4712 | if (STRINGP (visit)) |
| @@ -4714,8 +4715,6 @@ This does code conversion according to the value of | |||
| 4714 | visit_file = filename; | 4715 | visit_file = filename; |
| 4715 | UNGCPRO; | 4716 | UNGCPRO; |
| 4716 | 4717 | ||
| 4717 | annotations = Qnil; | ||
| 4718 | |||
| 4719 | if (NILP (lockname)) | 4718 | if (NILP (lockname)) |
| 4720 | lockname = visit_file; | 4719 | lockname = visit_file; |
| 4721 | 4720 | ||
| @@ -4755,7 +4754,20 @@ This does code conversion according to the value of | |||
| 4755 | count1 = specpdl_ptr - specpdl; | 4754 | count1 = specpdl_ptr - specpdl; |
| 4756 | 4755 | ||
| 4757 | given_buffer = current_buffer; | 4756 | given_buffer = current_buffer; |
| 4758 | annotations = build_annotations (start, end, coding.pre_write_conversion); | 4757 | annotations = build_annotations (start, end); |
| 4758 | if (current_buffer != given_buffer) | ||
| 4759 | { | ||
| 4760 | XSETFASTINT (start, BEGV); | ||
| 4761 | XSETFASTINT (end, ZV); | ||
| 4762 | } | ||
| 4763 | |||
| 4764 | UNGCPRO; | ||
| 4765 | |||
| 4766 | GCPRO5 (start, filename, annotations, visit_file, lockname); | ||
| 4767 | |||
| 4768 | given_buffer = current_buffer; | ||
| 4769 | annotations = build_annotations_2 (start, end, | ||
| 4770 | coding.pre_write_conversion, annotations); | ||
| 4759 | if (current_buffer != given_buffer) | 4771 | if (current_buffer != given_buffer) |
| 4760 | { | 4772 | { |
| 4761 | XSETFASTINT (start, BEGV); | 4773 | XSETFASTINT (start, BEGV); |
| @@ -5065,8 +5077,8 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0, | |||
| 5065 | as save-excursion would do. */ | 5077 | as save-excursion would do. */ |
| 5066 | 5078 | ||
| 5067 | static Lisp_Object | 5079 | static Lisp_Object |
| 5068 | build_annotations (start, end, pre_write_conversion) | 5080 | build_annotations (start, end) |
| 5069 | Lisp_Object start, end, pre_write_conversion; | 5081 | Lisp_Object start, end; |
| 5070 | { | 5082 | { |
| 5071 | Lisp_Object annotations; | 5083 | Lisp_Object annotations; |
| 5072 | Lisp_Object p, res; | 5084 | Lisp_Object p, res; |
| @@ -5127,6 +5139,18 @@ build_annotations (start, end, pre_write_conversion) | |||
| 5127 | annotations = merge (annotations, res, Qcar_less_than_car); | 5139 | annotations = merge (annotations, res, Qcar_less_than_car); |
| 5128 | } | 5140 | } |
| 5129 | 5141 | ||
| 5142 | UNGCPRO; | ||
| 5143 | return annotations; | ||
| 5144 | } | ||
| 5145 | |||
| 5146 | static Lisp_Object | ||
| 5147 | build_annotations_2 (start, end, pre_write_conversion, annotations) | ||
| 5148 | Lisp_Object start, end, pre_write_conversion, annotations; | ||
| 5149 | { | ||
| 5150 | struct gcpro gcpro1; | ||
| 5151 | Lisp_Object res; | ||
| 5152 | |||
| 5153 | GCPRO1 (annotations); | ||
| 5130 | /* At last, do the same for the function PRE_WRITE_CONVERSION | 5154 | /* At last, do the same for the function PRE_WRITE_CONVERSION |
| 5131 | implied by the current coding-system. */ | 5155 | implied by the current coding-system. */ |
| 5132 | if (!NILP (pre_write_conversion)) | 5156 | if (!NILP (pre_write_conversion)) |