summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-07-31 17:44:43 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-31 17:44:43 +0200
commitf6c5a801efdad6cc7ed16ac0b1fa53599b84bc91 (patch)
tree733b465030587f28fc1dbf2970d646245802517d /src/editfns.c
parentc4239ec32c944e74252937bfc52e341f81b7a5a4 (diff)
downloademacs-f6c5a801efdad6cc7ed16ac0b1fa53599b84bc91.tar.gz
emacs-f6c5a801efdad6cc7ed16ac0b1fa53599b84bc91.tar.bz2
emacs-f6c5a801efdad6cc7ed16ac0b1fa53599b84bc91.zip
Adjust how `replace-match' runs modification hooks
* src/editfns.c (Fsubst_char_in_region) (Ftranslate_region_internal): * src/cmds.c (internal_self_insert): Update callers. * src/insdel.c (replace_range): Allow inhibiting signal_after_change/update_compositions. * src/lisp.h: Update. * src/search.c (Freplace_match): Run the modification hooks at the end instead of before adjusting point (bug#42424).
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 8ab17ebc9f9..c8219decb06 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2371,7 +2371,7 @@ Both characters must have the same length of multi-byte form. */)
/* replace_range is less efficient, because it moves the gap,
but it handles combining correctly. */
replace_range (pos, pos + 1, string,
- false, false, true, false);
+ false, false, true, false, false);
pos_byte_next = CHAR_TO_BYTE (pos);
if (pos_byte_next > pos_byte)
/* Before combining happened. We should not increment
@@ -2578,7 +2578,7 @@ It returns the number of characters changed. */)
but it should handle multibyte characters correctly. */
string = make_multibyte_string ((char *) str, 1, str_len);
replace_range (pos, pos + 1, string,
- true, false, true, false);
+ true, false, true, false, false);
len = str_len;
}
else
@@ -2613,7 +2613,8 @@ It returns the number of characters changed. */)
= (VECTORP (val)
? Fconcat (1, &val)
: Fmake_string (make_fixnum (1), val, Qnil));
- replace_range (pos, pos + len, string, true, false, true, false);
+ replace_range (pos, pos + len, string, true, false, true, false,
+ false);
pos_byte += SBYTES (string);
pos += SCHARS (string);
characters_changed += SCHARS (string);