diff options
| author | Kenichi Handa | 1998-02-20 01:40:47 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-02-20 01:40:47 +0000 |
| commit | 2d9eea4477dda68e9fa018ddfa0dca19920d1fc2 (patch) | |
| tree | c527be5e2685ba9ea2db72bd3c1a20398825b7f5 /src | |
| parent | 2189766e34598fedf6d84b53bc78568b42c58306 (diff) | |
| download | emacs-2d9eea4477dda68e9fa018ddfa0dca19920d1fc2.tar.gz emacs-2d9eea4477dda68e9fa018ddfa0dca19920d1fc2.zip | |
(adjust_before_replace): Comment added.
(adjust_after_replace): Comment added. Give correct args to
adjust_point. Don't call signal_after_change here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/insdel.c b/src/insdel.c index 98d55e57d1f..461cf6da40d 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1076,6 +1076,12 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1076 | current_buffer, inherit); | 1076 | current_buffer, inherit); |
| 1077 | } | 1077 | } |
| 1078 | 1078 | ||
| 1079 | /* This function should be called after moving gap to FROM and before | ||
| 1080 | altering LEN chars of text starting from FROM. This adjusts | ||
| 1081 | various position keepers and markers and as if the text is deleted. | ||
| 1082 | Don't forget to call adjust_after_replace after you actually alter | ||
| 1083 | the text. */ | ||
| 1084 | |||
| 1079 | void | 1085 | void |
| 1080 | adjust_before_replace (from, from_byte, to, to_byte) | 1086 | adjust_before_replace (from, from_byte, to, to_byte) |
| 1081 | int from, from_byte, to, to_byte; | 1087 | int from, from_byte, to, to_byte; |
| @@ -1084,13 +1090,16 @@ adjust_before_replace (from, from_byte, to, to_byte) | |||
| 1084 | record_delete (from, to - from); | 1090 | record_delete (from, to - from); |
| 1085 | } | 1091 | } |
| 1086 | 1092 | ||
| 1093 | /* This function should be called after altering the text between FROM | ||
| 1094 | and TO to a new text of LEN chars (LEN_BYTE bytes). */ | ||
| 1095 | |||
| 1087 | void | 1096 | void |
| 1088 | adjust_after_replace (from, from_byte, to, to_byte, len, len_byte) | 1097 | adjust_after_replace (from, from_byte, to, to_byte, len, len_byte) |
| 1089 | int from, from_byte, to, to_byte, len, len_byte; | 1098 | int from, from_byte, to, to_byte, len, len_byte; |
| 1090 | { | 1099 | { |
| 1091 | record_insert (from, len); | 1100 | record_insert (from, len); |
| 1092 | if (from < PT) | 1101 | if (from < PT) |
| 1093 | adjust_point (len, len_byte); | 1102 | adjust_point (len - (to - from), len_byte - (to_byte - from_byte)); |
| 1094 | #ifdef USE_TEXT_PROPERTIES | 1103 | #ifdef USE_TEXT_PROPERTIES |
| 1095 | offset_intervals (current_buffer, PT, len - (to - from)); | 1104 | offset_intervals (current_buffer, PT, len - (to - from)); |
| 1096 | #endif | 1105 | #endif |
| @@ -1101,7 +1110,6 @@ adjust_after_replace (from, from_byte, to, to_byte, len, len_byte) | |||
| 1101 | if (len == 0) | 1110 | if (len == 0) |
| 1102 | evaporate_overlays (from); | 1111 | evaporate_overlays (from); |
| 1103 | MODIFF++; | 1112 | MODIFF++; |
| 1104 | signal_after_change (from, to - from, len); | ||
| 1105 | } | 1113 | } |
| 1106 | 1114 | ||
| 1107 | /* Replace the text from character positions FROM to TO with NEW, | 1115 | /* Replace the text from character positions FROM to TO with NEW, |