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)
This commit is contained in:
@@ -1139,6 +1139,12 @@ extern struct buffer buffer_local_flags;
|
||||
that don't have such names. */
|
||||
|
||||
extern struct buffer buffer_local_symbols;
|
||||
|
||||
/* verify_interval_modification saves insertion hooks here
|
||||
to be run later by report_interval_modification. */
|
||||
extern Lisp_Object interval_insert_behind_hooks;
|
||||
extern Lisp_Object interval_insert_in_front_hooks;
|
||||
|
||||
|
||||
extern void delete_all_overlays (struct buffer *);
|
||||
extern void reset_buffer (struct buffer *);
|
||||
|
||||
11
src/insdel.c
11
src/insdel.c
@@ -2201,7 +2201,7 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
|
||||
{
|
||||
ptrdiff_t count = SPECPDL_INDEX ();
|
||||
struct rvoe_arg rvoe_arg;
|
||||
Lisp_Object tmp;
|
||||
Lisp_Object tmp, save_insert_behind_hooks, save_insert_in_from_hooks;
|
||||
|
||||
if (inhibit_modification_hooks)
|
||||
return;
|
||||
@@ -2237,6 +2237,12 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Save and restore the insert-*-hooks, because other hooks like
|
||||
after-change-functions, called below, could clobber them if they
|
||||
manipulate text properties. */
|
||||
save_insert_behind_hooks = interval_insert_behind_hooks;
|
||||
save_insert_in_from_hooks = interval_insert_in_front_hooks;
|
||||
|
||||
if (!NILP (combine_after_change_list))
|
||||
Fcombine_after_change_execute ();
|
||||
|
||||
@@ -2259,6 +2265,9 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins)
|
||||
rvoe_arg.errorp = 0;
|
||||
}
|
||||
|
||||
interval_insert_behind_hooks = save_insert_behind_hooks;
|
||||
interval_insert_in_front_hooks = save_insert_in_from_hooks;
|
||||
|
||||
if (buffer_has_overlays ())
|
||||
report_overlay_modification (make_fixnum (charpos),
|
||||
make_fixnum (charpos + lenins),
|
||||
|
||||
@@ -58,9 +58,8 @@ enum property_set_type
|
||||
|
||||
/* verify_interval_modification saves insertion hooks here
|
||||
to be run later by report_interval_modification. */
|
||||
static Lisp_Object interval_insert_behind_hooks;
|
||||
static Lisp_Object interval_insert_in_front_hooks;
|
||||
|
||||
Lisp_Object interval_insert_behind_hooks;
|
||||
Lisp_Object interval_insert_in_front_hooks;
|
||||
|
||||
/* Signal a `text-read-only' error. This function makes it easier
|
||||
to capture that error in GDB by putting a breakpoint on it. */
|
||||
|
||||
Reference in New Issue
Block a user