aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-08-17 20:25:50 +0000
committerGerd Moellmann2000-08-17 20:25:50 +0000
commit532ed661555e0c4f2079bd4c6ac7fc0115e2135d (patch)
treeb9891e2b1e4376b60b8f2698d40e44e6cc9c1360 /src
parent10fa00732b57d3f009dc528131e96e3e545dc8b4 (diff)
downloademacs-532ed661555e0c4f2079bd4c6ac7fc0115e2135d.tar.gz
emacs-532ed661555e0c4f2079bd4c6ac7fc0115e2135d.zip
(build_annotations): Add a comment explaining the
return value of format-annotate-function. Replace a spurios call to Flength with a CONSP test. Call format-annotate-function with a fifth arg specifying how many times the function has been called in a row, to let it choose temporary buffers appropriately.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fileio.c b/src/fileio.c
index c6cea759bf4..38a605ad12f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4889,6 +4889,7 @@ build_annotations (start, end, pre_write_conversion)
4889 Lisp_Object p, res; 4889 Lisp_Object p, res;
4890 struct gcpro gcpro1, gcpro2; 4890 struct gcpro gcpro1, gcpro2;
4891 Lisp_Object original_buffer; 4891 Lisp_Object original_buffer;
4892 int i;
4892 4893
4893 XSETBUFFER (original_buffer, current_buffer); 4894 XSETBUFFER (original_buffer, current_buffer);
4894 4895
@@ -4921,21 +4922,26 @@ build_annotations (start, end, pre_write_conversion)
4921 p = Vauto_save_file_format; 4922 p = Vauto_save_file_format;
4922 else 4923 else
4923 p = current_buffer->file_format; 4924 p = current_buffer->file_format;
4924 while (!NILP (p)) 4925 for (i = 0; !NILP (p); p = Fcdr (p), ++i)
4925 { 4926 {
4926 struct buffer *given_buffer = current_buffer; 4927 struct buffer *given_buffer = current_buffer;
4928
4927 Vwrite_region_annotations_so_far = annotations; 4929 Vwrite_region_annotations_so_far = annotations;
4928 res = call4 (Qformat_annotate_function, Fcar (p), start, end, 4930
4929 original_buffer); 4931 /* Value is either a list of annotations or nil if the function
4932 has written annotations to a temporary buffer, which is now
4933 current. */
4934 res = call5 (Qformat_annotate_function, Fcar (p), start, end,
4935 original_buffer, make_number (i));
4930 if (current_buffer != given_buffer) 4936 if (current_buffer != given_buffer)
4931 { 4937 {
4932 XSETFASTINT (start, BEGV); 4938 XSETFASTINT (start, BEGV);
4933 XSETFASTINT (end, ZV); 4939 XSETFASTINT (end, ZV);
4934 annotations = Qnil; 4940 annotations = Qnil;
4935 } 4941 }
4936 Flength (res); 4942
4937 annotations = merge (annotations, res, Qcar_less_than_car); 4943 if (CONSP (res))
4938 p = Fcdr (p); 4944 annotations = merge (annotations, res, Qcar_less_than_car);
4939 } 4945 }
4940 4946
4941 /* At last, do the same for the function PRE_WRITE_CONVERSION 4947 /* At last, do the same for the function PRE_WRITE_CONVERSION