Index: buffer.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/buffer.c,v retrieving revision 1.480 diff -u -r1.480 buffer.c --- buffer.c 27 May 2005 11:01:38 -0000 1.480 +++ buffer.c 27 May 2005 17:06:47 -0000 @@ -178,6 +178,12 @@ Lisp_Object Qinsert_in_front_hooks; Lisp_Object Qinsert_behind_hooks; +#define OVERLAY_EVAPORATE_TESTING +#ifdef OVERLAY_EVAPORATE_TESTING +Lisp_Object Qnever_set; +static Lisp_Object evaporate_overlay P_ ((Lisp_Object)); +#endif + static void alloc_buffer_text P_ ((struct buffer *, size_t)); static void free_buffer_text P_ ((struct buffer *b)); static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *)); @@ -3602,6 +3608,11 @@ XOVERLAY (overlay)->plist = Qnil; XOVERLAY (overlay)->next = NULL; +#ifdef OVERLAY_EVAPORATE_TESTING + XOVERLAY (overlay)->plist + = Fcons (Qevaporate, Fcons (Qnever_set, XOVERLAY (overlay)->plist)); +#endif + /* Put the new overlay on the wrong list. */ end = OVERLAY_END (overlay); if (OVERLAY_POSITION (end) < b->overlay_center) @@ -3656,6 +3667,24 @@ Lisp_Object Fdelete_overlay (); +#ifdef OVERLAY_EVAPORATE_TESTING +static Lisp_Object +evaporate_overlay (overlay) + Lisp_Object overlay; +{ + if (EQ (Qnever_set, Foverlay_get (overlay, Qevaporate))) + { + Lisp_Object args[3]; + args[0] = build_string("WARNING: Evaporating %S %S"); + args[1] = overlay; + args[2] = Foverlay_properties(overlay); + Fmessage(3,args); + } + + return Fdelete_overlay (overlay); +} +#endif + static struct Lisp_Overlay * unchain_overlay (list, overlay) struct Lisp_Overlay *list, *overlay; @@ -3704,7 +3733,13 @@ CHECK_NUMBER_COERCE_MARKER (end); if (XINT (beg) == XINT (end) && ! NILP (Foverlay_get (overlay, Qevaporate))) - return Fdelete_overlay (overlay); + return +#ifndef OVERLAY_EVAPORATE_TESTING + Fdelete_overlay +#else + evaporate_overlay +#endif + (overlay); if (XINT (beg) > XINT (end)) { @@ -4088,7 +4123,13 @@ if (EQ (prop, Qevaporate) && ! NILP (value) && (OVERLAY_POSITION (OVERLAY_START (overlay)) == OVERLAY_POSITION (OVERLAY_END (overlay)))) - Fdelete_overlay (overlay); +#ifndef OVERLAY_EVAPORATE_TESTING + Fdelete_overlay +#else + evaporate_overlay +#endif + (overlay); + } return value; } @@ -4330,7 +4371,12 @@ hit_list = Fcons (overlay, hit_list); } for (; CONSP (hit_list); hit_list = XCDR (hit_list)) - Fdelete_overlay (XCAR (hit_list)); +#ifndef OVERLAY_EVAPORATE_TESTING + Fdelete_overlay +#else + evaporate_overlay +#endif + (XCAR (hit_list)); } /* Somebody has tried to store a value with an unacceptable type @@ -5207,6 +5253,10 @@ staticpro (&Qoverlayp); Qevaporate = intern ("evaporate"); staticpro (&Qevaporate); +#ifdef OVERLAY_EVAPORATE_TESTING + Qnever_set = intern ("never-set"); + staticpro (&Qnever_set); +#endif Qmodification_hooks = intern ("modification-hooks"); staticpro (&Qmodification_hooks); Qinsert_in_front_hooks = intern ("insert-in-front-hooks");