diff options
| author | Richard M. Stallman | 1998-03-11 00:47:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-11 00:47:48 +0000 |
| commit | ce97a2d7ed0eb52e291522ecdc23029c6002c839 (patch) | |
| tree | aa31dbfce914f0b32d0165b3dd6217a4f6a9ae80 | |
| parent | 93b882e857fae21b75d1ba41531e942f95ad634c (diff) | |
| download | emacs-ce97a2d7ed0eb52e291522ecdc23029c6002c839.tar.gz emacs-ce97a2d7ed0eb52e291522ecdc23029c6002c839.zip | |
(adjust_markers_for_insert): Don't leave a marker within
the combined_after_bytes. Use DEC than INC when leaving
a marker before the insertion.
(count_combining_before): Return number of bytes from start
of insertion that will combine.
(insert_1_both): Compensate for change in count_combining_before.
Delete intervals for the combined_after_bytes.
Compensate for that when updating other intervals.
(insert_from_buffer_1, replace_range): Likewise.
(adjust_after_replace): Likewise.
(insert_from_string_1): Likewise. Also handle intervals
for inserting just part of string.
| -rw-r--r-- | src/insdel.c | 148 |
1 files changed, 111 insertions, 37 deletions
diff --git a/src/insdel.c b/src/insdel.c index 265ecb30163..1e787e24fdb 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -394,10 +394,10 @@ adjust_markers_for_delete (from, from_byte, to, to_byte) | |||
| 394 | to TO / TO_BYTE. We have to relocate the charpos of every marker | 394 | to TO / TO_BYTE. We have to relocate the charpos of every marker |
| 395 | that points after the insertion (but not their bytepos). | 395 | that points after the insertion (but not their bytepos). |
| 396 | 396 | ||
| 397 | COMBINED_BEFORE_BYTES is the number of bytes before the insertion | 397 | COMBINED_BEFORE_BYTES is the number of bytes at the start of the insertion |
| 398 | that combines into one character with the first inserted bytes. | 398 | that combine into one character with the text before the insertion. |
| 399 | COMBINED_AFTER_BYTES is the number of bytes after the insertion | 399 | COMBINED_AFTER_BYTES is the number of bytes after the insertion |
| 400 | that combines into one character with the last inserted bytes. | 400 | that combine into one character with the last inserted bytes. |
| 401 | 401 | ||
| 402 | When a marker points at the insertion point, | 402 | When a marker points at the insertion point, |
| 403 | we advance it if either its insertion-type is t | 403 | we advance it if either its insertion-type is t |
| @@ -439,11 +439,26 @@ adjust_markers_for_insert (from, from_byte, to, to_byte, | |||
| 439 | but don't leave it pointing in the middle of a character. | 439 | but don't leave it pointing in the middle of a character. |
| 440 | Point the marker after the combined character, | 440 | Point the marker after the combined character, |
| 441 | so that undoing the insertion puts it back where it was. */ | 441 | so that undoing the insertion puts it back where it was. */ |
| 442 | m->bytepos -= combined_before_bytes; | 442 | |
| 443 | m->charpos -= 1; | 443 | /* Here we depend on the fact that the gap is after |
| 444 | all of the combining bytes that we are going to skip over. */ | ||
| 445 | DEC_BOTH (m->charpos, m->bytepos); | ||
| 444 | INC_BOTH (m->charpos, m->bytepos); | 446 | INC_BOTH (m->charpos, m->bytepos); |
| 445 | } | 447 | } |
| 446 | } | 448 | } |
| 449 | /* If a marker was pointing into the combining bytes | ||
| 450 | after the insertion, don't leave it there | ||
| 451 | in the middle of a character. */ | ||
| 452 | else if (combined_after_bytes && m->bytepos >= from_byte | ||
| 453 | && m->bytepos < from_byte + combined_after_bytes) | ||
| 454 | { | ||
| 455 | /* Put it after the combining bytes. */ | ||
| 456 | m->bytepos = to_byte + combined_after_bytes; | ||
| 457 | m->charpos = to + 1; | ||
| 458 | /* Now move it back before the combined character, | ||
| 459 | so that undoing the insertion will put it where it was. */ | ||
| 460 | DEC_BOTH (m->charpos, m->bytepos); | ||
| 461 | } | ||
| 447 | else if (m->bytepos > from_byte) | 462 | else if (m->bytepos > from_byte) |
| 448 | { | 463 | { |
| 449 | m->bytepos += nbytes; | 464 | m->bytepos += nbytes; |
| @@ -762,7 +777,7 @@ insert_1 (string, nbytes, inherit, prepare, before_markers) | |||
| 762 | 777 | ||
| 763 | /* See if the bytes before POS/POS_BYTE combine with bytes | 778 | /* See if the bytes before POS/POS_BYTE combine with bytes |
| 764 | at the start of STRING to form a single character. | 779 | at the start of STRING to form a single character. |
| 765 | If so, return the number of bytes before POS/POS_BYTE | 780 | If so, return the number of bytes at the start of STRING |
| 766 | which combine in this way. Otherwise, return 0. */ | 781 | which combine in this way. Otherwise, return 0. */ |
| 767 | 782 | ||
| 768 | int | 783 | int |
| @@ -773,6 +788,7 @@ count_combining_before (string, length, pos, pos_byte) | |||
| 773 | { | 788 | { |
| 774 | int opos = pos, opos_byte = pos_byte; | 789 | int opos = pos, opos_byte = pos_byte; |
| 775 | int c; | 790 | int c; |
| 791 | unsigned char *p = string; | ||
| 776 | 792 | ||
| 777 | if (NILP (current_buffer->enable_multibyte_characters)) | 793 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 778 | return 0; | 794 | return 0; |
| @@ -787,7 +803,13 @@ count_combining_before (string, length, pos, pos_byte) | |||
| 787 | c = FETCH_BYTE (pos_byte); | 803 | c = FETCH_BYTE (pos_byte); |
| 788 | if (! BASE_LEADING_CODE_P (c)) | 804 | if (! BASE_LEADING_CODE_P (c)) |
| 789 | return 0; | 805 | return 0; |
| 790 | return opos_byte - pos_byte; | 806 | |
| 807 | /* We have a combination situation. | ||
| 808 | Count the bytes at STRING that will combine. */ | ||
| 809 | while (!CHAR_HEAD_P (*p) && p < string + length) | ||
| 810 | p++; | ||
| 811 | |||
| 812 | return p - string; | ||
| 791 | } | 813 | } |
| 792 | 814 | ||
| 793 | /* See if the bytes after POS/POS_BYTE combine with bytes | 815 | /* See if the bytes after POS/POS_BYTE combine with bytes |
| @@ -859,11 +881,8 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 859 | combined_after_bytes = count_combining_after (string, nbytes, PT, PT_BYTE); | 881 | combined_after_bytes = count_combining_after (string, nbytes, PT, PT_BYTE); |
| 860 | 882 | ||
| 861 | /* This is the net amount that Z will increase from this insertion. */ | 883 | /* This is the net amount that Z will increase from this insertion. */ |
| 862 | /* The combined bytes before all count as one character, because | ||
| 863 | they start with a leading code, but the combined bytes after | ||
| 864 | count as separate characters, because they are all trailing codes. */ | ||
| 865 | 884 | ||
| 866 | adjusted_nchars = nchars - !!combined_before_bytes - combined_after_bytes; | 885 | adjusted_nchars = nchars - combined_before_bytes - combined_after_bytes; |
| 867 | 886 | ||
| 868 | if (prepare) | 887 | if (prepare) |
| 869 | prepare_to_modify_buffer (PT - !!combined_before_bytes, | 888 | prepare_to_modify_buffer (PT - !!combined_before_bytes, |
| @@ -895,7 +914,9 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 895 | #endif | 914 | #endif |
| 896 | 915 | ||
| 897 | GAP_SIZE -= nbytes; | 916 | GAP_SIZE -= nbytes; |
| 898 | GPT += nchars - !! combined_before_bytes - !!combined_after_bytes; | 917 | /* When we have combining at the end of the insertion, |
| 918 | this is the character position before the combined character. */ | ||
| 919 | GPT += nchars - combined_before_bytes - !!combined_after_bytes; | ||
| 899 | ZV += adjusted_nchars; | 920 | ZV += adjusted_nchars; |
| 900 | Z += adjusted_nchars; | 921 | Z += adjusted_nchars; |
| 901 | GPT_BYTE += nbytes; | 922 | GPT_BYTE += nbytes; |
| @@ -907,6 +928,20 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 907 | PT + adjusted_nchars, PT_BYTE + nbytes, | 928 | PT + adjusted_nchars, PT_BYTE + nbytes, |
| 908 | combined_before_bytes, combined_after_bytes, | 929 | combined_before_bytes, combined_after_bytes, |
| 909 | before_markers); | 930 | before_markers); |
| 931 | |||
| 932 | /* "Delete" the combined-after bytes, as far as intervals are concerned. | ||
| 933 | Note that as far as the intervals are concerned, | ||
| 934 | no insertion has yet taken place, so these bytes are right after PT. */ | ||
| 935 | if (combined_after_bytes) | ||
| 936 | offset_intervals (current_buffer, PT, - combined_after_bytes); | ||
| 937 | |||
| 938 | #ifdef USE_TEXT_PROPERTIES | ||
| 939 | if (!inherit && BUF_INTERVALS (current_buffer) != 0) | ||
| 940 | Fset_text_properties (make_number (PT), | ||
| 941 | make_number (PT + adjusted_nchars + combined_after_bytes), | ||
| 942 | Qnil, Qnil); | ||
| 943 | #endif | ||
| 944 | |||
| 910 | adjust_point (adjusted_nchars + combined_after_bytes, | 945 | adjust_point (adjusted_nchars + combined_after_bytes, |
| 911 | nbytes + combined_after_bytes); | 946 | nbytes + combined_after_bytes); |
| 912 | 947 | ||
| @@ -915,12 +950,6 @@ insert_1_both (string, nchars, nbytes, inherit, prepare, before_markers) | |||
| 915 | 950 | ||
| 916 | if (GPT_BYTE < GPT) | 951 | if (GPT_BYTE < GPT) |
| 917 | abort (); | 952 | abort (); |
| 918 | |||
| 919 | #ifdef USE_TEXT_PROPERTIES | ||
| 920 | if (!inherit && BUF_INTERVALS (current_buffer) != 0) | ||
| 921 | Fset_text_properties (make_number (PT - adjusted_nchars), make_number (PT), | ||
| 922 | Qnil, Qnil); | ||
| 923 | #endif | ||
| 924 | } | 953 | } |
| 925 | 954 | ||
| 926 | /* Insert the part of the text of STRING, a Lisp object assumed to be | 955 | /* Insert the part of the text of STRING, a Lisp object assumed to be |
| @@ -980,6 +1009,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 980 | int outgoing_nbytes = nbytes; | 1009 | int outgoing_nbytes = nbytes; |
| 981 | int combined_before_bytes, combined_after_bytes; | 1010 | int combined_before_bytes, combined_after_bytes; |
| 982 | int adjusted_nchars; | 1011 | int adjusted_nchars; |
| 1012 | INTERVAL intervals; | ||
| 983 | 1013 | ||
| 984 | /* Make OUTGOING_NBYTES describe the text | 1014 | /* Make OUTGOING_NBYTES describe the text |
| 985 | as it will be inserted in this buffer. */ | 1015 | as it will be inserted in this buffer. */ |
| @@ -1029,7 +1059,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1029 | PT, PT_BYTE); | 1059 | PT, PT_BYTE); |
| 1030 | 1060 | ||
| 1031 | /* This is the net amount that Z will increase from this insertion. */ | 1061 | /* This is the net amount that Z will increase from this insertion. */ |
| 1032 | adjusted_nchars = nchars - !!combined_before_bytes - combined_after_bytes; | 1062 | adjusted_nchars = nchars - combined_before_bytes - combined_after_bytes; |
| 1033 | 1063 | ||
| 1034 | /* Record deletion of the surrounding text that combines with | 1064 | /* Record deletion of the surrounding text that combines with |
| 1035 | the insertion. This, together with recording the insertion, | 1065 | the insertion. This, together with recording the insertion, |
| @@ -1051,7 +1081,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1051 | offset_intervals (current_buffer, PT, adjusted_nchars); | 1081 | offset_intervals (current_buffer, PT, adjusted_nchars); |
| 1052 | 1082 | ||
| 1053 | GAP_SIZE -= outgoing_nbytes; | 1083 | GAP_SIZE -= outgoing_nbytes; |
| 1054 | GPT += nchars - !!combined_before_bytes - !!combined_after_bytes; | 1084 | GPT += nchars - combined_before_bytes - !!combined_after_bytes; |
| 1055 | ZV += adjusted_nchars; | 1085 | ZV += adjusted_nchars; |
| 1056 | Z += adjusted_nchars; | 1086 | Z += adjusted_nchars; |
| 1057 | GPT_BYTE += outgoing_nbytes; | 1087 | GPT_BYTE += outgoing_nbytes; |
| @@ -1070,8 +1100,24 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1070 | if (GPT_BYTE < GPT) | 1100 | if (GPT_BYTE < GPT) |
| 1071 | abort (); | 1101 | abort (); |
| 1072 | 1102 | ||
| 1073 | graft_intervals_into_buffer (XSTRING (string)->intervals, PT, nchars, | 1103 | /* "Delete" the combined-after bytes, as far as intervals are concerned. |
| 1104 | Note that as far as the intervals are concerned, | ||
| 1105 | no insertion has yet taken place, so these bytes are right after PT. */ | ||
| 1106 | if (combined_after_bytes) | ||
| 1107 | offset_intervals (current_buffer, PT, - combined_after_bytes); | ||
| 1108 | |||
| 1109 | /* Get the intervals for the part of the string we are inserting-- | ||
| 1110 | not including the combined-before bytes. */ | ||
| 1111 | intervals = XSTRING (string)->intervals; | ||
| 1112 | if (combined_before_bytes != 0 | ||
| 1113 | || nbytes < XSTRING (string)->size_byte) | ||
| 1114 | intervals = copy_intervals (intervals, pos + combined_before_bytes, | ||
| 1115 | nchars - combined_before_bytes); | ||
| 1116 | |||
| 1117 | /* Insert those intervals. */ | ||
| 1118 | graft_intervals_into_buffer (intervals, PT, nchars - combined_before_bytes, | ||
| 1074 | current_buffer, inherit); | 1119 | current_buffer, inherit); |
| 1120 | |||
| 1075 | adjust_point (adjusted_nchars + combined_after_bytes, | 1121 | adjust_point (adjusted_nchars + combined_after_bytes, |
| 1076 | outgoing_nbytes + combined_after_bytes); | 1122 | outgoing_nbytes + combined_after_bytes); |
| 1077 | } | 1123 | } |
| @@ -1112,6 +1158,7 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1112 | int outgoing_nbytes = incoming_nbytes; | 1158 | int outgoing_nbytes = incoming_nbytes; |
| 1113 | int combined_before_bytes, combined_after_bytes; | 1159 | int combined_before_bytes, combined_after_bytes; |
| 1114 | int adjusted_nchars; | 1160 | int adjusted_nchars; |
| 1161 | INTERVAL intervals; | ||
| 1115 | 1162 | ||
| 1116 | /* Make OUTGOING_NBYTES describe the text | 1163 | /* Make OUTGOING_NBYTES describe the text |
| 1117 | as it will be inserted in this buffer. */ | 1164 | as it will be inserted in this buffer. */ |
| @@ -1165,7 +1212,7 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1165 | PT, PT_BYTE); | 1212 | PT, PT_BYTE); |
| 1166 | 1213 | ||
| 1167 | /* This is the net amount that Z will increase from this insertion. */ | 1214 | /* This is the net amount that Z will increase from this insertion. */ |
| 1168 | adjusted_nchars = nchars - !!combined_before_bytes - combined_after_bytes; | 1215 | adjusted_nchars = nchars - combined_before_bytes - combined_after_bytes; |
| 1169 | 1216 | ||
| 1170 | /* Record deletion of the surrounding text that combines with | 1217 | /* Record deletion of the surrounding text that combines with |
| 1171 | the insertion. This, together with recording the insertion, | 1218 | the insertion. This, together with recording the insertion, |
| @@ -1189,7 +1236,7 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1189 | #endif | 1236 | #endif |
| 1190 | 1237 | ||
| 1191 | GAP_SIZE -= outgoing_nbytes; | 1238 | GAP_SIZE -= outgoing_nbytes; |
| 1192 | GPT += nchars - !!combined_before_bytes - !!combined_after_bytes; | 1239 | GPT += nchars - combined_before_bytes - !!combined_after_bytes; |
| 1193 | ZV += adjusted_nchars; | 1240 | ZV += adjusted_nchars; |
| 1194 | Z += adjusted_nchars; | 1241 | Z += adjusted_nchars; |
| 1195 | GPT_BYTE += outgoing_nbytes; | 1242 | GPT_BYTE += outgoing_nbytes; |
| @@ -1200,6 +1247,26 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1200 | adjust_markers_for_insert (PT, PT_BYTE, PT + adjusted_nchars, | 1247 | adjust_markers_for_insert (PT, PT_BYTE, PT + adjusted_nchars, |
| 1201 | PT_BYTE + outgoing_nbytes, | 1248 | PT_BYTE + outgoing_nbytes, |
| 1202 | combined_before_bytes, combined_after_bytes, 0); | 1249 | combined_before_bytes, combined_after_bytes, 0); |
| 1250 | |||
| 1251 | /* "Delete" the combined-after bytes, as far as intervals are concerned. | ||
| 1252 | Note that as far as the intervals are concerned, | ||
| 1253 | no insertion has yet taken place, so these bytes are right after PT. */ | ||
| 1254 | if (combined_after_bytes) | ||
| 1255 | offset_intervals (current_buffer, PT, - combined_after_bytes); | ||
| 1256 | |||
| 1257 | /* Get the intervals for the part of the string we are inserting-- | ||
| 1258 | not including the combined-before bytes. */ | ||
| 1259 | intervals = BUF_INTERVALS (buf); | ||
| 1260 | if (combined_before_bytes != 0 | ||
| 1261 | || nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf)) | ||
| 1262 | intervals = copy_intervals (intervals, from + combined_before_bytes, | ||
| 1263 | nchars - combined_before_bytes); | ||
| 1264 | |||
| 1265 | /* Insert those intervals. */ | ||
| 1266 | graft_intervals_into_buffer (intervals, PT, nchars - combined_before_bytes, | ||
| 1267 | current_buffer, inherit); | ||
| 1268 | |||
| 1269 | |||
| 1203 | adjust_point (adjusted_nchars + combined_after_bytes, | 1270 | adjust_point (adjusted_nchars + combined_after_bytes, |
| 1204 | outgoing_nbytes + combined_after_bytes); | 1271 | outgoing_nbytes + combined_after_bytes); |
| 1205 | 1272 | ||
| @@ -1208,12 +1275,6 @@ insert_from_buffer_1 (buf, from, nchars, inherit) | |||
| 1208 | 1275 | ||
| 1209 | if (GPT_BYTE < GPT) | 1276 | if (GPT_BYTE < GPT) |
| 1210 | abort (); | 1277 | abort (); |
| 1211 | |||
| 1212 | /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ | ||
| 1213 | graft_intervals_into_buffer (copy_intervals (BUF_INTERVALS (buf), | ||
| 1214 | from, nchars), | ||
| 1215 | PT - adjusted_nchars, adjusted_nchars, | ||
| 1216 | current_buffer, inherit); | ||
| 1217 | } | 1278 | } |
| 1218 | 1279 | ||
| 1219 | /* This function should be called after moving gap to FROM and before | 1280 | /* This function should be called after moving gap to FROM and before |
| @@ -1241,7 +1302,7 @@ adjust_after_replace (from, from_byte, to, to_byte, len, len_byte, | |||
| 1241 | int from, from_byte, to, to_byte, len, len_byte; | 1302 | int from, from_byte, to, to_byte, len, len_byte; |
| 1242 | int combined_before_bytes, combined_after_bytes; | 1303 | int combined_before_bytes, combined_after_bytes; |
| 1243 | { | 1304 | { |
| 1244 | int adjusted_nchars = len - !!combined_before_bytes - combined_after_bytes; | 1305 | int adjusted_nchars = len - combined_before_bytes - combined_after_bytes; |
| 1245 | record_insert (from - !!combined_before_bytes, len); | 1306 | record_insert (from - !!combined_before_bytes, len); |
| 1246 | if (from < PT) | 1307 | if (from < PT) |
| 1247 | adjust_point (len - (to - from) + combined_after_bytes, | 1308 | adjust_point (len - (to - from) + combined_after_bytes, |
| @@ -1282,6 +1343,7 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1282 | struct gcpro gcpro1; | 1343 | struct gcpro gcpro1; |
| 1283 | int combined_before_bytes, combined_after_bytes; | 1344 | int combined_before_bytes, combined_after_bytes; |
| 1284 | int adjusted_inschars; | 1345 | int adjusted_inschars; |
| 1346 | INTERVAL intervals; | ||
| 1285 | 1347 | ||
| 1286 | GCPRO1 (new); | 1348 | GCPRO1 (new); |
| 1287 | 1349 | ||
| @@ -1363,7 +1425,7 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1363 | 1425 | ||
| 1364 | /* This is the net amount that Z will increase from this insertion. */ | 1426 | /* This is the net amount that Z will increase from this insertion. */ |
| 1365 | adjusted_inschars | 1427 | adjusted_inschars |
| 1366 | = inschars - !!combined_before_bytes - combined_after_bytes; | 1428 | = inschars - combined_before_bytes - combined_after_bytes; |
| 1367 | 1429 | ||
| 1368 | /* Record deletion of the surrounding text that combines with | 1430 | /* Record deletion of the surrounding text that combines with |
| 1369 | the insertion. This, together with recording the insertion, | 1431 | the insertion. This, together with recording the insertion, |
| @@ -1395,7 +1457,7 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1395 | #endif | 1457 | #endif |
| 1396 | 1458 | ||
| 1397 | GAP_SIZE -= insbytes; | 1459 | GAP_SIZE -= insbytes; |
| 1398 | GPT += inschars - !!combined_before_bytes - !!combined_after_bytes; | 1460 | GPT += inschars - combined_before_bytes - !!combined_after_bytes; |
| 1399 | ZV += adjusted_inschars; | 1461 | ZV += adjusted_inschars; |
| 1400 | Z += adjusted_inschars; | 1462 | Z += adjusted_inschars; |
| 1401 | GPT_BYTE += insbytes; | 1463 | GPT_BYTE += insbytes; |
| @@ -1414,11 +1476,23 @@ replace_range (from, to, new, prepare, inherit) | |||
| 1414 | from_byte + insbytes, | 1476 | from_byte + insbytes, |
| 1415 | combined_before_bytes, combined_after_bytes, 0); | 1477 | combined_before_bytes, combined_after_bytes, 0); |
| 1416 | 1478 | ||
| 1417 | #ifdef USE_TEXT_PROPERTIES | 1479 | /* "Delete" the combined-after bytes, as far as intervals are concerned. |
| 1418 | /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ | 1480 | Note that as far as the intervals are concerned, |
| 1419 | graft_intervals_into_buffer (XSTRING (new)->intervals, from, | 1481 | no insertion has yet taken place, so these bytes are right after PT. */ |
| 1420 | inschars, current_buffer, inherit); | 1482 | if (combined_after_bytes) |
| 1421 | #endif | 1483 | offset_intervals (current_buffer, PT, - combined_after_bytes); |
| 1484 | |||
| 1485 | /* Get the intervals for the part of the string we are inserting-- | ||
| 1486 | not including the combined-before bytes. */ | ||
| 1487 | intervals = XSTRING (new)->intervals; | ||
| 1488 | if (combined_before_bytes != 0) | ||
| 1489 | intervals = copy_intervals (intervals, combined_before_bytes, | ||
| 1490 | inschars - combined_before_bytes); | ||
| 1491 | |||
| 1492 | /* Insert those intervals. */ | ||
| 1493 | graft_intervals_into_buffer (intervals, from, | ||
| 1494 | inschars - combined_before_bytes, | ||
| 1495 | current_buffer, inherit); | ||
| 1422 | 1496 | ||
| 1423 | if (insbytes == 0) | 1497 | if (insbytes == 0) |
| 1424 | evaporate_overlays (from); | 1498 | evaporate_overlays (from); |