1038 |
} |
} |
1039 |
|
|
1040 |
/* Insert a sequence of NCHARS chars which occupy NBYTES bytes |
/* Insert a sequence of NCHARS chars which occupy NBYTES bytes |
1041 |
starting at GPT_ADDR. This funciton assumes PT == GPT. */ |
starting at GPT_ADDR. */ |
1042 |
|
|
1043 |
void |
void |
1044 |
insert_from_gap (nchars, nbytes) |
insert_from_gap (nchars, nbytes) |
1045 |
register int nchars, nbytes; |
register int nchars, nbytes; |
1046 |
{ |
{ |
|
if (PT != GPT) |
|
|
abort (); |
|
|
|
|
1047 |
if (NILP (current_buffer->enable_multibyte_characters)) |
if (NILP (current_buffer->enable_multibyte_characters)) |
1048 |
nchars = nbytes; |
nchars = nbytes; |
1049 |
|
|
1050 |
record_insert (PT, nchars); |
record_insert (GPT, nchars); |
1051 |
MODIFF++; |
MODIFF++; |
1052 |
|
|
1053 |
GAP_SIZE -= nbytes; |
GAP_SIZE -= nbytes; |
1062 |
if (GPT_BYTE < GPT) |
if (GPT_BYTE < GPT) |
1063 |
abort (); |
abort (); |
1064 |
|
|
1065 |
adjust_overlays_for_insert (PT, nchars); |
adjust_overlays_for_insert (GPT, nchars); |
1066 |
adjust_markers_for_insert (PT, PT_BYTE, |
adjust_markers_for_insert (GPT, GPT_BYTE, |
1067 |
PT + nchars, PT_BYTE + nbytes, |
GPT + nchars, GPT_BYTE + nbytes, |
1068 |
0); |
0); |
1069 |
|
|
1070 |
if (BUF_INTERVALS (current_buffer) != 0) |
if (BUF_INTERVALS (current_buffer) != 0) |
1071 |
offset_intervals (current_buffer, PT, nchars); |
offset_intervals (current_buffer, PT, nchars); |
1072 |
|
|
1073 |
adjust_point (nchars, nbytes); |
if (GPT - nchars < PT) |
1074 |
|
adjust_point (nchars, nbytes); |
1075 |
|
|
1076 |
CHECK_MARKERS (); |
CHECK_MARKERS (); |
1077 |
} |
} |