* src/insdel.c (replace_range): Merge last arg, with `prepare`.
Rename `prepare` to `run-mode-hooks`.
* src/lisp.h (replace_range): Adjust accordingly.
* src/editfns.c (Ftranslate_region_internal):
* src/cmds.c (internal_self_insert):
* src/search.c (Freplace_match): Adjust callers.
(cherry picked from commit
41624d94cec98c1239c4fc9bb624e55ce0606068)
ptrdiff_t to;
if (ckd_add (&to, PT, chars_to_delete))
to = PTRDIFF_MAX;
- replace_range (PT, to, string, 1, 1, 1, 0, false);
+ replace_range (PT, to, string, true, true, true, false);
Fforward_char (make_fixnum (n));
}
else if (n > 1)
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, false);
+ true, false, true, false);
len = str_len;
}
else
= (VECTORP (val)
? Fconcat (1, &val)
: Fmake_string (make_fixnum (1), val, Qnil));
- replace_range (pos, pos + len, string, true, false, true, false,
- false);
+ replace_range (pos, pos + len, string, true, false, true, false);
pos_byte += SBYTES (string);
pos += SCHARS (string);
characters_changed += SCHARS (string);
void
replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
- bool prepare, bool inherit, bool markers,
- bool adjust_match_data, bool inhibit_mod_hooks)
+ bool run_mod_hooks, bool inherit, bool markers,
+ bool adjust_match_data)
{
ptrdiff_t inschars = SCHARS (new);
ptrdiff_t insbytes = SBYTES (new);
deletion = Qnil;
- if (prepare)
+ if (run_mod_hooks)
{
ptrdiff_t range_length = to - from;
prepare_to_modify_buffer (from, to, &from);
if (adjust_match_data)
update_search_regs (from, to, from + SCHARS (new));
- if (!inhibit_mod_hooks)
+ if (run_mod_hooks)
{
signal_after_change (from, nchars_del, GPT - from);
update_compositions (from, GPT, CHECK_BORDER);
extern void adjust_markers_bytepos (ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, int);
extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, bool, bool,
- bool, bool, bool);
+ bool, bool);
extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
const char *, ptrdiff_t, ptrdiff_t, bool);
extern void syms_of_insdel (void);
newpoint = sub_start + SCHARS (newtext);
/* Replace the old text with the new in the cleanest possible way. */
- replace_range (sub_start, sub_end, newtext, 1, 0, 1, true, false);
+ replace_range (sub_start, sub_end, newtext, true, false, true, true);
if (case_action == all_caps)
Fupcase_region (make_fixnum (search_regs.start[sub]),