diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c index b76a024cd32..ed8c3518644 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2044,19 +2044,32 @@ verify_overlay_modification (start, end) | |||
| 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 | ||
| @@ -2078,19 +2091,31 @@ verify_overlay_modification (start, end) | |||
| 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 | } |