diff options
| author | Noam Postavsky | 2018-09-15 09:44:30 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-09-15 09:44:30 -0400 |
| commit | ffbe561ee5acb0b9edc5f4c995c287fb2485c315 (patch) | |
| tree | 9833822d627c9d7695b69fdc6d7eab514b22096d /src | |
| parent | f1ddaf7b65bb8edac41813b48f96a84c7fc2e263 (diff) | |
| download | emacs-ffbe561ee5acb0b9edc5f4c995c287fb2485c315.tar.gz emacs-ffbe561ee5acb0b9edc5f4c995c287fb2485c315.zip | |
Don't call modification hooks unprepared
Inhibit modification hooks when performing message coalescing because
in that case, we aren't doing the necessary preparation for running
modification hooks (i.e., we pass PREPARE=false for the insert_1_both
and del_range_both calls). See also Bug#30823 and Bug#21824.
* src/xdisp.c (message_dolog): Let-bind inhibit-modification-hooks
to t around del_range_both calls.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 47286e25c80..93cd54a3240 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10417,6 +10417,13 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) | |||
| 10417 | ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; | 10417 | ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte; |
| 10418 | printmax_t dups; | 10418 | printmax_t dups; |
| 10419 | 10419 | ||
| 10420 | /* Since we call del_range_both passing false for PREPARE, | ||
| 10421 | we aren't prepared to run modification hooks (we could | ||
| 10422 | end up calling modification hooks from another buffer and | ||
| 10423 | only with AFTER=t, Bug#21824). */ | ||
| 10424 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 10425 | specbind (Qinhibit_modification_hooks, Qt); | ||
| 10426 | |||
| 10420 | insert_1_both ("\n", 1, 1, true, false, false); | 10427 | insert_1_both ("\n", 1, 1, true, false, false); |
| 10421 | 10428 | ||
| 10422 | scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false); | 10429 | scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false); |
| @@ -10462,6 +10469,8 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) | |||
| 10462 | -XFIXNAT (Vmessage_log_max) - 1, false); | 10469 | -XFIXNAT (Vmessage_log_max) - 1, false); |
| 10463 | del_range_both (BEG, BEG_BYTE, PT, PT_BYTE, false); | 10470 | del_range_both (BEG, BEG_BYTE, PT, PT_BYTE, false); |
| 10464 | } | 10471 | } |
| 10472 | |||
| 10473 | unbind_to (count, Qnil); | ||
| 10465 | } | 10474 | } |
| 10466 | BEGV = marker_position (oldbegv); | 10475 | BEGV = marker_position (oldbegv); |
| 10467 | BEGV_BYTE = marker_byte_position (oldbegv); | 10476 | BEGV_BYTE = marker_byte_position (oldbegv); |