aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-11 11:30:43 +0000
committerRichard M. Stallman1994-12-11 11:30:43 +0000
commit930a91400a2ec774bded1a6257cc3cffda70b736 (patch)
tree6ca5e38572dfda571d34804f99ade84017e1eee7 /src/buffer.c
parent835220e85365938b42cec1e69ea27ffba3f77407 (diff)
downloademacs-930a91400a2ec774bded1a6257cc3cffda70b736.tar.gz
emacs-930a91400a2ec774bded1a6257cc3cffda70b736.zip
(report_overlay_modification): Renamed from verify_overlay_modification.
(call_overlay_mod_hooks): New args AFTER, ARG1, ARG2, ARG3. Args START, END deleted. Pass each function AFTER, ARG1 and ARG2, and ARG3 if ARG3 is not nil. (verify_overlay_modification): New args AFTER, ARG1, ARG2, ARG3. Pass them to call_overlay_mod_hooks.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4d4169c22ca..e4d8932458d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2281,20 +2281,27 @@ DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,
2281/* Run the modification-hooks of overlays that include 2281/* Run the modification-hooks of overlays that include
2282 any part of the text in START to END. 2282 any part of the text in START to END.
2283 Run the insert-before-hooks of overlay starting at END, 2283 Run the insert-before-hooks of overlay starting at END,
2284 and the insert-after-hooks of overlay ending at START. */ 2284 and the insert-after-hooks of overlay ending at START.
2285
2286 This is called both before and after the modification.
2287 AFTER is nonzero when we call after the modification.
2288
2289 ARG1, ARG2, ARG3 are arguments to pass to the hook functions. */
2285 2290
2286void 2291void
2287verify_overlay_modification (start, end) 2292report_overlay_modification (start, end, after, arg1, arg2, arg3)
2288 Lisp_Object start, end; 2293 Lisp_Object start, end;
2294 int after;
2295 Lisp_Object arg1, arg2, arg3;
2289{ 2296{
2290 Lisp_Object prop, overlay, tail; 2297 Lisp_Object prop, overlay, tail;
2291 int insertion = EQ (start, end); 2298 int insertion = EQ (start, end);
2292 int tail_copied; 2299 int tail_copied;
2293 struct gcpro gcpro1, gcpro2; 2300 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
2294 2301
2295 overlay = Qnil; 2302 overlay = Qnil;
2296 tail = Qnil; 2303 tail = Qnil;
2297 GCPRO2 (overlay, tail); 2304 GCPRO5 (overlay, tail, arg1, arg2, arg3);
2298 2305
2299 tail_copied = 0; 2306 tail_copied = 0;
2300 for (tail = current_buffer->overlays_before; 2307 for (tail = current_buffer->overlays_before;
@@ -2321,7 +2328,7 @@ verify_overlay_modification (start, end)
2321 if (!tail_copied) 2328 if (!tail_copied)
2322 tail = Fcopy_sequence (tail); 2329 tail = Fcopy_sequence (tail);
2323 tail_copied = 1; 2330 tail_copied = 1;
2324 call_overlay_mod_hooks (prop, overlay, start, end); 2331 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2325 } 2332 }
2326 } 2333 }
2327 if (XFASTINT (start) == endpos && insertion) 2334 if (XFASTINT (start) == endpos && insertion)
@@ -2332,7 +2339,7 @@ verify_overlay_modification (start, end)
2332 if (!tail_copied) 2339 if (!tail_copied)
2333 tail = Fcopy_sequence (tail); 2340 tail = Fcopy_sequence (tail);
2334 tail_copied = 1; 2341 tail_copied = 1;
2335 call_overlay_mod_hooks (prop, overlay, start, end); 2342 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2336 } 2343 }
2337 } 2344 }
2338 /* Test for intersecting intervals. This does the right thing 2345 /* Test for intersecting intervals. This does the right thing
@@ -2345,7 +2352,7 @@ verify_overlay_modification (start, end)
2345 if (!tail_copied) 2352 if (!tail_copied)
2346 tail = Fcopy_sequence (tail); 2353 tail = Fcopy_sequence (tail);
2347 tail_copied = 1; 2354 tail_copied = 1;
2348 call_overlay_mod_hooks (prop, overlay, start, end); 2355 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2349 } 2356 }
2350 } 2357 }
2351 } 2358 }
@@ -2374,7 +2381,7 @@ verify_overlay_modification (start, end)
2374 if (!tail_copied) 2381 if (!tail_copied)
2375 tail = Fcopy_sequence (tail); 2382 tail = Fcopy_sequence (tail);
2376 tail_copied = 1; 2383 tail_copied = 1;
2377 call_overlay_mod_hooks (prop, overlay, start, end); 2384 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2378 } 2385 }
2379 } 2386 }
2380 if (XFASTINT (start) == endpos && insertion) 2387 if (XFASTINT (start) == endpos && insertion)
@@ -2385,7 +2392,7 @@ verify_overlay_modification (start, end)
2385 if (!tail_copied) 2392 if (!tail_copied)
2386 tail = Fcopy_sequence (tail); 2393 tail = Fcopy_sequence (tail);
2387 tail_copied = 1; 2394 tail_copied = 1;
2388 call_overlay_mod_hooks (prop, overlay, start, end); 2395 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2389 } 2396 }
2390 } 2397 }
2391 /* Test for intersecting intervals. This does the right thing 2398 /* Test for intersecting intervals. This does the right thing
@@ -2398,7 +2405,7 @@ verify_overlay_modification (start, end)
2398 if (!tail_copied) 2405 if (!tail_copied)
2399 tail = Fcopy_sequence (tail); 2406 tail = Fcopy_sequence (tail);
2400 tail_copied = 1; 2407 tail_copied = 1;
2401 call_overlay_mod_hooks (prop, overlay, start, end); 2408 call_overlay_mod_hooks (prop, overlay, after, arg1, arg2, arg3);
2402 } 2409 }
2403 } 2410 }
2404 } 2411 }
@@ -2407,14 +2414,19 @@ verify_overlay_modification (start, end)
2407} 2414}
2408 2415
2409static void 2416static void
2410call_overlay_mod_hooks (list, overlay, start, end) 2417call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3)
2411 Lisp_Object list, overlay, start, end; 2418 Lisp_Object list, overlay;
2419 int after;
2420 Lisp_Object arg1, arg2, arg3;
2412{ 2421{
2413 struct gcpro gcpro1; 2422 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
2414 GCPRO1 (list); 2423 GCPRO4 (list, arg1, arg2, arg3);
2415 while (!NILP (list)) 2424 while (!NILP (list))
2416 { 2425 {
2417 call3 (Fcar (list), overlay, start, end); 2426 if (NILP (arg3))
2427 call4 (Fcar (list), overlay, after ? Qt : Qnil, arg1, arg2);
2428 else
2429 call5 (Fcar (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3);
2418 list = Fcdr (list); 2430 list = Fcdr (list);
2419 } 2431 }
2420 UNGCPRO; 2432 UNGCPRO;