aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-07-13 21:04:07 +0000
committerRichard M. Stallman1993-07-13 21:04:07 +0000
commitf7a9275a0e5752cdfe367c63096775b98e9af831 (patch)
tree55ae369ac140e9ad555313564b9b8a5bfd6cac83 /src
parenta399c5363f07c16f67eb4a344fac9570b3531b32 (diff)
downloademacs-f7a9275a0e5752cdfe367c63096775b98e9af831.tar.gz
emacs-f7a9275a0e5752cdfe367c63096775b98e9af831.zip
(Qinsert_in_front_hooks, Qinsert_behind_hooks): New vars.
(syms_of_textprop): Set them up. (set_properties): Call modify_region. (remove_properties): Call modify_region before record_property_change. (add_properties): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/textprop.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 13d2b4edd9a..e16f44c8932 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -44,6 +44,8 @@ Lisp_Object Qmouse_entered;
44Lisp_Object Qpoint_left; 44Lisp_Object Qpoint_left;
45Lisp_Object Qpoint_entered; 45Lisp_Object Qpoint_entered;
46Lisp_Object Qmodification_hooks; 46Lisp_Object Qmodification_hooks;
47Lisp_Object Qinsert_in_front_hooks;
48Lisp_Object Qinsert_behind_hooks;
47Lisp_Object Qcategory; 49Lisp_Object Qcategory;
48Lisp_Object Qlocal_map; 50Lisp_Object Qlocal_map;
49 51
@@ -276,9 +278,14 @@ set_properties (properties, interval, object)
276 sym = XCONS (value)->cdr) 278 sym = XCONS (value)->cdr)
277 if (! EQ (property_value (properties, XCONS (sym)->car), 279 if (! EQ (property_value (properties, XCONS (sym)->car),
278 XCONS (value)->car)) 280 XCONS (value)->car))
279 record_property_change (interval->position, LENGTH (interval), 281 {
280 XCONS (sym)->car, XCONS (value)->car, 282 modify_region (XBUFFER (object),
281 object); 283 make_number (interval->position),
284 make_number (interval->position + LENGTH (interval)));
285 record_property_change (interval->position, LENGTH (interval),
286 XCONS (sym)->car, XCONS (value)->car,
287 object);
288 }
282 289
283 /* For each new property that has no value at all in the old plist, 290 /* For each new property that has no value at all in the old plist,
284 make an undo record binding it to nil, so it will be removed. */ 291 make an undo record binding it to nil, so it will be removed. */
@@ -286,9 +293,14 @@ set_properties (properties, interval, object)
286 PLIST_ELT_P (sym, value); 293 PLIST_ELT_P (sym, value);
287 sym = XCONS (value)->cdr) 294 sym = XCONS (value)->cdr)
288 if (EQ (property_value (interval->plist, XCONS (sym)->car), Qunbound)) 295 if (EQ (property_value (interval->plist, XCONS (sym)->car), Qunbound))
289 record_property_change (interval->position, LENGTH (interval), 296 {
290 XCONS (sym)->car, Qnil, 297 modify_region (XBUFFER (object),
291 object); 298 make_number (interval->position),
299 make_number (interval->position + LENGTH (interval)));
300 record_property_change (interval->position, LENGTH (interval),
301 XCONS (sym)->car, Qnil,
302 object);
303 }
292 } 304 }
293 305
294 /* Store new properties. */ 306 /* Store new properties. */
@@ -338,11 +350,11 @@ add_properties (plist, i, object)
338 /* Record this change in the buffer, for undo purposes. */ 350 /* Record this change in the buffer, for undo purposes. */
339 if (XTYPE (object) == Lisp_Buffer) 351 if (XTYPE (object) == Lisp_Buffer)
340 { 352 {
341 record_property_change (i->position, LENGTH (i),
342 sym1, Fcar (this_cdr), object);
343 modify_region (XBUFFER (object), 353 modify_region (XBUFFER (object),
344 make_number (i->position), 354 make_number (i->position),
345 make_number (i->position + LENGTH (i))); 355 make_number (i->position + LENGTH (i)));
356 record_property_change (i->position, LENGTH (i),
357 sym1, Fcar (this_cdr), object);
346 } 358 }
347 359
348 /* I's property has a different value -- change it */ 360 /* I's property has a different value -- change it */
@@ -356,11 +368,11 @@ add_properties (plist, i, object)
356 /* Record this change in the buffer, for undo purposes. */ 368 /* Record this change in the buffer, for undo purposes. */
357 if (XTYPE (object) == Lisp_Buffer) 369 if (XTYPE (object) == Lisp_Buffer)
358 { 370 {
359 record_property_change (i->position, LENGTH (i),
360 sym1, Qnil, object);
361 modify_region (XBUFFER (object), 371 modify_region (XBUFFER (object),
362 make_number (i->position), 372 make_number (i->position),
363 make_number (i->position + LENGTH (i))); 373 make_number (i->position + LENGTH (i)));
374 record_property_change (i->position, LENGTH (i),
375 sym1, Qnil, object);
364 } 376 }
365 i->plist = Fcons (sym1, Fcons (val1, i->plist)); 377 i->plist = Fcons (sym1, Fcons (val1, i->plist));
366 changed++; 378 changed++;
@@ -394,12 +406,12 @@ remove_properties (plist, i, object)
394 { 406 {
395 if (XTYPE (object) == Lisp_Buffer) 407 if (XTYPE (object) == Lisp_Buffer)
396 { 408 {
397 record_property_change (i->position, LENGTH (i),
398 sym, Fcar (Fcdr (current_plist)),
399 object);
400 modify_region (XBUFFER (object), 409 modify_region (XBUFFER (object),
401 make_number (i->position), 410 make_number (i->position),
402 make_number (i->position + LENGTH (i))); 411 make_number (i->position + LENGTH (i)));
412 record_property_change (i->position, LENGTH (i),
413 sym, Fcar (Fcdr (current_plist)),
414 object);
403 } 415 }
404 416
405 current_plist = Fcdr (Fcdr (current_plist)); 417 current_plist = Fcdr (Fcdr (current_plist));
@@ -415,11 +427,11 @@ remove_properties (plist, i, object)
415 { 427 {
416 if (XTYPE (object) == Lisp_Buffer) 428 if (XTYPE (object) == Lisp_Buffer)
417 { 429 {
418 record_property_change (i->position, LENGTH (i),
419 sym, Fcar (Fcdr (this)), object);
420 modify_region (XBUFFER (object), 430 modify_region (XBUFFER (object),
421 make_number (i->position), 431 make_number (i->position),
422 make_number (i->position + LENGTH (i))); 432 make_number (i->position + LENGTH (i)));
433 record_property_change (i->position, LENGTH (i),
434 sym, Fcar (Fcdr (this)), object);
423 } 435 }
424 436
425 Fsetcdr (Fcdr (tail2), Fcdr (Fcdr (this))); 437 Fsetcdr (Fcdr (tail2), Fcdr (Fcdr (this)));
@@ -1132,6 +1144,10 @@ percentage by which the left interval tree should not differ from the right.");
1132 Qpoint_entered = intern ("point-entered"); 1144 Qpoint_entered = intern ("point-entered");
1133 staticpro (&Qmodification_hooks); 1145 staticpro (&Qmodification_hooks);
1134 Qmodification_hooks = intern ("modification-hooks"); 1146 Qmodification_hooks = intern ("modification-hooks");
1147 staticpro (&Qinsert_in_front_hooks);
1148 Qinsert_in_front_hooks = intern ("insert-in-front-hooks");
1149 staticpro (&Qinsert_behind_hooks);
1150 Qinsert_behind_hooks = intern ("insert-behind-hooks");
1135 1151
1136 defsubr (&Stext_properties_at); 1152 defsubr (&Stext_properties_at);
1137 defsubr (&Sget_text_property); 1153 defsubr (&Sget_text_property);