diff options
| author | Stefan Monnier | 2019-05-06 14:58:20 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-06 14:58:20 -0400 |
| commit | c31823a51bba1e4f0c87af1a08ce856cc600f5c8 (patch) | |
| tree | 50dfe2876a5b7ab85cee4c8603da7172324781f1 /src | |
| parent | 66c388c21aa83d3ddb5a1827f81dd432514242ac (diff) | |
| download | emacs-c31823a51bba1e4f0c87af1a08ce856cc600f5c8.tar.gz emacs-c31823a51bba1e4f0c87af1a08ce856cc600f5c8.zip | |
Make combine-after-change-calls work in the common case again
* src/insdel.c (signal_after_change): Allow combine_after_change_calls
even when syntax-ppss-flush-cache is on before-change-functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c index 1231bb2682b..85fffd8fd16 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -2178,6 +2178,7 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins) | |||
| 2178 | { | 2178 | { |
| 2179 | ptrdiff_t count = SPECPDL_INDEX (); | 2179 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2180 | struct rvoe_arg rvoe_arg; | 2180 | struct rvoe_arg rvoe_arg; |
| 2181 | Lisp_Object tmp; | ||
| 2181 | 2182 | ||
| 2182 | if (inhibit_modification_hooks) | 2183 | if (inhibit_modification_hooks) |
| 2183 | return; | 2184 | return; |
| @@ -2186,7 +2187,16 @@ signal_after_change (ptrdiff_t charpos, ptrdiff_t lendel, ptrdiff_t lenins) | |||
| 2186 | and there are no before-change functions, | 2187 | and there are no before-change functions, |
| 2187 | just record the args that we were going to use. */ | 2188 | just record the args that we were going to use. */ |
| 2188 | if (! NILP (Vcombine_after_change_calls) | 2189 | if (! NILP (Vcombine_after_change_calls) |
| 2189 | && NILP (Vbefore_change_functions) | 2190 | /* It's OK to defer after-changes even if syntax-ppss-flush-cache |
| 2191 | * is on before-change-functions, which is common enough to be worth | ||
| 2192 | * adding a special case for it. */ | ||
| 2193 | && (NILP (Vbefore_change_functions) | ||
| 2194 | || (CONSP (Vbefore_change_functions) | ||
| 2195 | && EQ (Qt, XCAR (Vbefore_change_functions)) | ||
| 2196 | && NILP (Fdefault_value (Qbefore_change_functions)) | ||
| 2197 | && CONSP (tmp = XCDR (Vbefore_change_functions)) | ||
| 2198 | && NILP (XCDR (tmp)) | ||
| 2199 | && EQ (XCAR (tmp), Qsyntax_ppss_flush_cache))) | ||
| 2190 | && !buffer_has_overlays ()) | 2200 | && !buffer_has_overlays ()) |
| 2191 | { | 2201 | { |
| 2192 | Lisp_Object elt; | 2202 | Lisp_Object elt; |
| @@ -2343,6 +2353,7 @@ syms_of_insdel (void) | |||
| 2343 | combine_after_change_buffer = Qnil; | 2353 | combine_after_change_buffer = Qnil; |
| 2344 | 2354 | ||
| 2345 | DEFSYM (Qundo_auto__undoable_change, "undo-auto--undoable-change"); | 2355 | DEFSYM (Qundo_auto__undoable_change, "undo-auto--undoable-change"); |
| 2356 | DEFSYM (Qsyntax_ppss_flush_cache, "syntax-ppss-flush-cache"); | ||
| 2346 | 2357 | ||
| 2347 | DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls, | 2358 | DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls, |
| 2348 | doc: /* Used internally by the function `combine-after-change-calls' macro. */); | 2359 | doc: /* Used internally by the function `combine-after-change-calls' macro. */); |