diff options
| author | Eli Zaretskii | 2019-09-19 17:10:00 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-09-19 17:10:00 +0300 |
| commit | 2b80340bf3585f976d88da94ee9d40eb03230c6b (patch) | |
| tree | 84ec6b3c9f4751ce5ee76366582577dbc9b38646 | |
| parent | 7156b0efc714eaaab5bcf42138752f698e57b5ad (diff) | |
| download | emacs-2b80340bf3585f976d88da94ee9d40eb03230c6b.tar.gz emacs-2b80340bf3585f976d88da94ee9d40eb03230c6b.zip | |
Fix calls to insert-*-hooks when JIT font lock is active
* src/insdel.c (signal_after_change): Save and restore
interval_insert_behind_hooks and
interval_insert_in_front_hooks across calls to various other
hooks, to prevent their clobbering by those other hooks.
(Bug#37455)
| -rw-r--r-- | src/buffer.h | 6 | ||||
| -rw-r--r-- | src/insdel.c | 11 | ||||
| -rw-r--r-- | src/textprop.c | 5 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/buffer.h b/src/buffer.h index 82d9350bfc2..280d4e9098e 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1139,6 +1139,12 @@ extern struct buffer buffer_local_flags; | |||
| 1139 | that don't have such names. */ | 1139 | that don't have such names. */ |
| 1140 | 1140 | ||
| 1141 | extern struct buffer buffer_local_symbols; | 1141 | extern struct buffer buffer_local_symbols; |
| 1142 | |||
| 1143 | /* verify_interval_modification saves insertion hooks here | ||
| 1144 | to be run later by report_interval_modification. */ | ||
| 1145 | extern Lisp_Object interval_insert_behind_hooks; | ||
| 1146 | extern Lisp_Object interval_insert_in_front_hooks; | ||
| 1147 | |||
| 1142 | 1148 | ||
| 1143 | extern void delete_all_overlays (struct buffer *); | 1149 | extern void delete_all_overlays (struct buffer *); |
| 1144 | extern void reset_buffer (struct buffer *); | 1150 | extern void reset_buffer (struct buffer *); |
diff --git a/src/insdel.c b/src/insdel.c index 1da8d551c73..093b841d6d6 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -2201,7 +2201,7 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins) | |||
| 2201 | { | 2201 | { |
| 2202 | ptrdiff_t count = SPECPDL_INDEX (); | 2202 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2203 | struct rvoe_arg rvoe_arg; | 2203 | struct rvoe_arg rvoe_arg; |
| 2204 | Lisp_Object tmp; | 2204 | Lisp_Object tmp, save_insert_behind_hooks, save_insert_in_from_hooks; |
| 2205 | 2205 | ||
| 2206 | if (inhibit_modification_hooks) | 2206 | if (inhibit_modification_hooks) |
| 2207 | return; | 2207 | return; |
| @@ -2237,6 +2237,12 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins) | |||
| 2237 | return; | 2237 | return; |
| 2238 | } | 2238 | } |
| 2239 | 2239 | ||
| 2240 | /* Save and restore the insert-*-hooks, because other hooks like | ||
| 2241 | after-change-functions, called below, could clobber them if they | ||
| 2242 | manipulate text properties. */ | ||
| 2243 | save_insert_behind_hooks = interval_insert_behind_hooks; | ||
| 2244 | save_insert_in_from_hooks = interval_insert_in_front_hooks; | ||
| 2245 | |||
| 2240 | if (!NILP (combine_after_change_list)) | 2246 | if (!NILP (combine_after_change_list)) |
| 2241 | Fcombine_after_change_execute (); | 2247 | Fcombine_after_change_execute (); |
| 2242 | 2248 | ||
| @@ -2259,6 +2265,9 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins) | |||
| 2259 | rvoe_arg.errorp = 0; | 2265 | rvoe_arg.errorp = 0; |
| 2260 | } | 2266 | } |
| 2261 | 2267 | ||
| 2268 | interval_insert_behind_hooks = save_insert_behind_hooks; | ||
| 2269 | interval_insert_in_front_hooks = save_insert_in_from_hooks; | ||
| 2270 | |||
| 2262 | if (buffer_has_overlays ()) | 2271 | if (buffer_has_overlays ()) |
| 2263 | report_overlay_modification (make_fixnum (charpos), | 2272 | report_overlay_modification (make_fixnum (charpos), |
| 2264 | make_fixnum (charpos + lenins), | 2273 | make_fixnum (charpos + lenins), |
diff --git a/src/textprop.c b/src/textprop.c index 44c333256a6..d36b9e14a69 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -58,9 +58,8 @@ enum property_set_type | |||
| 58 | 58 | ||
| 59 | /* verify_interval_modification saves insertion hooks here | 59 | /* verify_interval_modification saves insertion hooks here |
| 60 | to be run later by report_interval_modification. */ | 60 | to be run later by report_interval_modification. */ |
| 61 | static Lisp_Object interval_insert_behind_hooks; | 61 | Lisp_Object interval_insert_behind_hooks; |
| 62 | static Lisp_Object interval_insert_in_front_hooks; | 62 | Lisp_Object interval_insert_in_front_hooks; |
| 63 | |||
| 64 | 63 | ||
| 65 | /* Signal a `text-read-only' error. This function makes it easier | 64 | /* Signal a `text-read-only' error. This function makes it easier |
| 66 | to capture that error in GDB by putting a breakpoint on it. */ | 65 | to capture that error in GDB by putting a breakpoint on it. */ |