comparison src/buffer.c @ 6591:60f70854e73f

(verify_overlay_modification): Copy TAIL before a hook, in case the hook recenters the overlay lists.
author Richard M. Stallman <rms@gnu.org>
date Wed, 30 Mar 1994 06:32:54 +0000
parents 33a461f14903
children 49120b664bba
comparison
equal deleted inserted replaced
6590:2c66255e9469 6591:60f70854e73f
2042 break; 2042 break;
2043 startpos = OVERLAY_POSITION (ostart); 2043 startpos = OVERLAY_POSITION (ostart);
2044 if (XFASTINT (end) == startpos && insertion) 2044 if (XFASTINT (end) == startpos && insertion)
2045 { 2045 {
2046 prop = Foverlay_get (overlay, Qinsert_in_front_hooks); 2046 prop = Foverlay_get (overlay, Qinsert_in_front_hooks);
2047 call_overlay_mod_hooks (prop, overlay, start, end); 2047 if (!NILP (prop))
2048 {
2049 /* Copy TAIL in case the hook recenters the overlay lists. */
2050 tail = Fcopy_sequence (tail);
2051 call_overlay_mod_hooks (prop, overlay, start, end);
2052 }
2048 } 2053 }
2049 if (XFASTINT (start) == endpos && insertion) 2054 if (XFASTINT (start) == endpos && insertion)
2050 { 2055 {
2051 prop = Foverlay_get (overlay, Qinsert_behind_hooks); 2056 prop = Foverlay_get (overlay, Qinsert_behind_hooks);
2052 call_overlay_mod_hooks (prop, overlay, start, end); 2057 if (!NILP (prop))
2058 {
2059 tail = Fcopy_sequence (tail);
2060 call_overlay_mod_hooks (prop, overlay, start, end);
2061 }
2053 } 2062 }
2054 if (insertion 2063 if (insertion
2055 ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos) 2064 ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos)
2056 : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos)) 2065 : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos))
2057 { 2066 {
2058 prop = Foverlay_get (overlay, Qmodification_hooks); 2067 prop = Foverlay_get (overlay, Qmodification_hooks);
2059 call_overlay_mod_hooks (prop, overlay, start, end); 2068 if (!NILP (prop))
2069 {
2070 tail = Fcopy_sequence (tail);
2071 call_overlay_mod_hooks (prop, overlay, start, end);
2072 }
2060 } 2073 }
2061 } 2074 }
2062 2075
2063 for (tail = current_buffer->overlays_after; 2076 for (tail = current_buffer->overlays_after;
2064 CONSP (tail); 2077 CONSP (tail);
2076 if (XFASTINT (end) < startpos) 2089 if (XFASTINT (end) < startpos)
2077 break; 2090 break;
2078 if (XFASTINT (end) == startpos && insertion) 2091 if (XFASTINT (end) == startpos && insertion)
2079 { 2092 {
2080 prop = Foverlay_get (overlay, Qinsert_in_front_hooks); 2093 prop = Foverlay_get (overlay, Qinsert_in_front_hooks);
2081 call_overlay_mod_hooks (prop, overlay, start, end); 2094 if (!NILP (prop))
2095 {
2096 tail = Fcopy_sequence (tail);
2097 call_overlay_mod_hooks (prop, overlay, start, end);
2098 }
2082 } 2099 }
2083 if (XFASTINT (start) == endpos && insertion) 2100 if (XFASTINT (start) == endpos && insertion)
2084 { 2101 {
2085 prop = Foverlay_get (overlay, Qinsert_behind_hooks); 2102 prop = Foverlay_get (overlay, Qinsert_behind_hooks);
2086 call_overlay_mod_hooks (prop, overlay, start, end); 2103 if (!NILP (prop))
2104 {
2105 tail = Fcopy_sequence (tail);
2106 call_overlay_mod_hooks (prop, overlay, start, end);
2107 }
2087 } 2108 }
2088 if (insertion 2109 if (insertion
2089 ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos) 2110 ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos)
2090 : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos)) 2111 : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos))
2091 { 2112 {
2092 prop = Foverlay_get (overlay, Qmodification_hooks); 2113 prop = Foverlay_get (overlay, Qmodification_hooks);
2093 call_overlay_mod_hooks (prop, overlay, start, end); 2114 if (!NILP (prop))
2115 {
2116 tail = Fcopy_sequence (tail);
2117 call_overlay_mod_hooks (prop, overlay, start, end);
2118 }
2094 } 2119 }
2095 } 2120 }
2096 } 2121 }
2097 2122
2098 static void 2123 static void