Commit 2d9eea44 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(adjust_before_replace): Comment added.

(adjust_after_replace): Comment added.  Give correct args to
adjust_point.  Don't call signal_after_change here.
parent 2189766e
......@@ -1076,6 +1076,12 @@ insert_from_buffer_1 (buf, from, nchars, inherit)
current_buffer, inherit);
/* This function should be called after moving gap to FROM and before
altering LEN chars of text starting from FROM. This adjusts
various position keepers and markers and as if the text is deleted.
Don't forget to call adjust_after_replace after you actually alter
the text. */
adjust_before_replace (from, from_byte, to, to_byte)
int from, from_byte, to, to_byte;
......@@ -1084,13 +1090,16 @@ adjust_before_replace (from, from_byte, to, to_byte)
record_delete (from, to - from);
/* This function should be called after altering the text between FROM
and TO to a new text of LEN chars (LEN_BYTE bytes). */
adjust_after_replace (from, from_byte, to, to_byte, len, len_byte)
int from, from_byte, to, to_byte, len, len_byte;
record_insert (from, len);
if (from < PT)
adjust_point (len, len_byte);
adjust_point (len - (to - from), len_byte - (to_byte - from_byte));
offset_intervals (current_buffer, PT, len - (to - from));
......@@ -1101,7 +1110,6 @@ adjust_after_replace (from, from_byte, to, to_byte, len, len_byte)
if (len == 0)
evaporate_overlays (from);
signal_after_change (from, to - from, len);
/* Replace the text from character positions FROM to TO with NEW,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment