183 |
|
|
184 |
/* Functions to be called to create text property annotations for file. */ |
/* Functions to be called to create text property annotations for file. */ |
185 |
Lisp_Object Vwrite_region_annotate_functions; |
Lisp_Object Vwrite_region_annotate_functions; |
186 |
|
Lisp_Object Qwrite_region_annotate_functions; |
187 |
|
|
188 |
/* During build_annotations, each time an annotation function is called, |
/* During build_annotations, each time an annotation function is called, |
189 |
this holds the annotations made by the previous functions. */ |
this holds the annotations made by the previous functions. */ |
5218 |
Lisp_Object p, res; |
Lisp_Object p, res; |
5219 |
struct gcpro gcpro1, gcpro2; |
struct gcpro gcpro1, gcpro2; |
5220 |
Lisp_Object original_buffer; |
Lisp_Object original_buffer; |
5221 |
int i; |
int i, used_global = 0; |
5222 |
|
|
5223 |
XSETBUFFER (original_buffer, current_buffer); |
XSETBUFFER (original_buffer, current_buffer); |
5224 |
|
|
5228 |
while (CONSP (p)) |
while (CONSP (p)) |
5229 |
{ |
{ |
5230 |
struct buffer *given_buffer = current_buffer; |
struct buffer *given_buffer = current_buffer; |
5231 |
|
if (EQ (Qt, XCAR (p)) && !used_global) |
5232 |
|
{ /* Use the global value of the hook. */ |
5233 |
|
Lisp_Object arg[2]; |
5234 |
|
used_global = 1; |
5235 |
|
arg[0] = Fdefault_value (Qwrite_region_annotate_functions); |
5236 |
|
arg[1] = XCDR (p); |
5237 |
|
p = Fappend (2, arg); |
5238 |
|
continue; |
5239 |
|
} |
5240 |
Vwrite_region_annotations_so_far = annotations; |
Vwrite_region_annotations_so_far = annotations; |
5241 |
res = call2 (XCAR (p), start, end); |
res = call2 (XCAR (p), start, end); |
5242 |
/* If the function makes a different buffer current, |
/* If the function makes a different buffer current, |
6459 |
insert before the first byte written). The POSITIONs must be sorted into |
insert before the first byte written). The POSITIONs must be sorted into |
6460 |
increasing order. If there are several functions in the list, the several |
increasing order. If there are several functions in the list, the several |
6461 |
lists are merged destructively. Alternatively, the function can return |
lists are merged destructively. Alternatively, the function can return |
6462 |
with a different buffer current and value nil.*/); |
with a different buffer current; in that case it should pay attention |
6463 |
|
to the annotations returned by previous functions and listed in |
6464 |
|
`write-region-annotations-so-far'.*/); |
6465 |
Vwrite_region_annotate_functions = Qnil; |
Vwrite_region_annotate_functions = Qnil; |
6466 |
|
staticpro (&Qwrite_region_annotate_functions); |
6467 |
|
Qwrite_region_annotate_functions |
6468 |
|
= intern ("write-region-annotate-functions"); |
6469 |
|
|
6470 |
DEFVAR_LISP ("write-region-annotations-so-far", |
DEFVAR_LISP ("write-region-annotations-so-far", |
6471 |
&Vwrite_region_annotations_so_far, |
&Vwrite_region_annotations_so_far, |