ptrdiff_t to;
if (ckd_add (&to, PT, chars_to_delete))
to = PTRDIFF_MAX;
- replace_range (PT, to, string, true, true, true, false);
+ replace_range (PT, to, string, 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);
+ true, false, 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);
+ replace_range (pos, pos + len, string, true, false, 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 run_mod_hooks, bool inherit, bool markers,
+ bool run_mod_hooks, bool inherit,
bool adjust_match_data)
{
ptrdiff_t inschars = SCHARS (new);
eassert (GPT <= GPT_BYTE);
/* Adjust markers for the deletion and the insertion. */
- if (markers)
- adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
- inschars, outgoing_insbytes);
- else
- {
- /* The character positions of the markers remain intact, but we
- still need to update their byte positions, because the
- deleted and the inserted text might have multibyte sequences
- which make the original byte positions of the markers
- invalid. */
- adjust_markers_bytepos (from, from_byte, from + inschars,
- from_byte + outgoing_insbytes, true);
- }
+ adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
+ inschars, outgoing_insbytes);
offset_intervals (current_buffer, from, inschars - nchars_del);
ptrdiff_t, ptrdiff_t, bool);
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);
+extern void replace_range (ptrdiff_t, ptrdiff_t, Lisp_Object, 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, true, false, true, true);
+ replace_range (sub_start, sub_end, newtext, true, false, true);
if (case_action == all_caps)
Fupcase_region (make_fixnum (search_regs.start[sub]),