aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-08-17 20:25:50 +0000
committerGerd Moellmann <[email protected]>2000-08-17 20:25:50 +0000
commit532ed661555e0c4f2079bd4c6ac7fc0115e2135d (patch)
treeb9891e2b1e4376b60b8f2698d40e44e6cc9c1360 /src/fileio.c
parent10fa00732b57d3f009dc528131e96e3e545dc8b4 (diff)
(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/fileio.c')
-rw-r--r--src/fileio.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fileio.c b/src/fileio.c
index c6cea759bf..38a605ad12 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4889,6 +4889,7 @@ build_annotations (start, end, pre_write_conversion)
Lisp_Object p, res;
struct gcpro gcpro1, gcpro2;
Lisp_Object original_buffer;
+ int i;
XSETBUFFER (original_buffer, current_buffer);
@@ -4921,21 +4922,26 @@ build_annotations (start, end, pre_write_conversion)
p = Vauto_save_file_format;
else
p = current_buffer->file_format;
- while (!NILP (p))
+ for (i = 0; !NILP (p); p = Fcdr (p), ++i)
{
struct buffer *given_buffer = current_buffer;
+
Vwrite_region_annotations_so_far = annotations;
- res = call4 (Qformat_annotate_function, Fcar (p), start, end,
- original_buffer);
+
+ /* Value is either a list of annotations or nil if the function
+ has written annotations to a temporary buffer, which is now
+ current. */
+ res = call5 (Qformat_annotate_function, Fcar (p), start, end,
+ original_buffer, make_number (i));
if (current_buffer != given_buffer)
{
XSETFASTINT (start, BEGV);
XSETFASTINT (end, ZV);
annotations = Qnil;
}
- Flength (res);
- annotations = merge (annotations, res, Qcar_less_than_car);
- p = Fcdr (p);
+
+ if (CONSP (res))
+ annotations = merge (annotations, res, Qcar_less_than_car);
}
/* At last, do the same for the function PRE_WRITE_CONVERSION