aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-01-22 01:26:45 +0000
committerKenichi Handa1998-01-22 01:26:45 +0000
commit1e9c7b7d916db7d9a54cb112bce8e6b03610b1b4 (patch)
tree3da23264b32d41e68bf0483aadafadeed8672c25 /src
parent321fecde5bcc50f5591618d3b4ec6bd7fe1dfdff (diff)
downloademacs-1e9c7b7d916db7d9a54cb112bce8e6b03610b1b4.tar.gz
emacs-1e9c7b7d916db7d9a54cb112bce8e6b03610b1b4.zip
(adjust_before_replace, adjust_after_replace): New
functions.
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 52cedb63fab..aaf5de38217 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1072,6 +1072,34 @@ insert_from_buffer_1 (buf, from, nchars, inherit)
1072 current_buffer, inherit); 1072 current_buffer, inherit);
1073} 1073}
1074 1074
1075void
1076adjust_before_replace (from, from_byte, to, to_byte)
1077 int from, from_byte, to, to_byte;
1078{
1079 adjust_markers_for_delete (from, from_byte, to, to_byte);
1080 record_delete (from, to - from);
1081}
1082
1083void
1084adjust_after_replace (from, from_byte, to, to_byte, len, len_byte)
1085 int from, from_byte, to, to_byte, len, len_byte;
1086{
1087 record_insert (from, len);
1088 if (from < PT)
1089 adjust_point (len, len_byte);
1090#ifdef USE_TEXT_PROPERTIES
1091 offset_intervals (current_buffer, PT, len - (to - from));
1092#endif
1093 adjust_overlays_for_delete (from, to - from);
1094 adjust_overlays_for_insert (from, len);
1095 adjust_markers_for_insert (from, from_byte,
1096 from + len, from_byte + len_byte, 0);
1097 if (len == 0)
1098 evaporate_overlays (from);
1099 MODIFF++;
1100 signal_after_change (from, to - from, len);
1101}
1102
1075/* Replace the text from character positions FROM to TO with NEW, 1103/* Replace the text from character positions FROM to TO with NEW,
1076 If PREPARE is nonzero, call prepare_to_modify_buffer. 1104 If PREPARE is nonzero, call prepare_to_modify_buffer.
1077 If INHERIT, the newly inserted text should inherit text properties 1105 If INHERIT, the newly inserted text should inherit text properties