584 |
int real_gap_loc_byte; |
int real_gap_loc_byte; |
585 |
int real_Z; |
int real_Z; |
586 |
int real_Z_byte; |
int real_Z_byte; |
587 |
int old_gap_size; |
int real_beg_unchanged; |
588 |
|
int new_gap_size; |
589 |
|
|
590 |
/* Make sure the gap is at least 20 bytes. */ |
/* Make sure the gap is at least 20 bytes. */ |
591 |
if (GAP_SIZE - nbytes_removed < 20) |
if (GAP_SIZE - nbytes_removed < 20) |
597 |
|
|
598 |
real_gap_loc = GPT; |
real_gap_loc = GPT; |
599 |
real_gap_loc_byte = GPT_BYTE; |
real_gap_loc_byte = GPT_BYTE; |
600 |
old_gap_size = GAP_SIZE; |
new_gap_size = GAP_SIZE - nbytes_removed; |
601 |
real_Z = Z; |
real_Z = Z; |
602 |
real_Z_byte = Z_BYTE; |
real_Z_byte = Z_BYTE; |
603 |
|
real_beg_unchanged = BEG_UNCHANGED; |
604 |
|
|
605 |
/* Pretend that the last unwanted part of the gap is the entire gap, |
/* Pretend that the last unwanted part of the gap is the entire gap, |
606 |
and that the first desired part of the gap is part of the buffer |
and that the first desired part of the gap is part of the buffer |
607 |
text. */ |
text. */ |
608 |
bzero (GPT_ADDR, GAP_SIZE - nbytes_removed); |
bzero (GPT_ADDR, new_gap_size); |
609 |
GPT += GAP_SIZE - nbytes_removed; |
GPT += new_gap_size; |
610 |
GPT_BYTE += GAP_SIZE - nbytes_removed; |
GPT_BYTE += new_gap_size; |
611 |
Z += GAP_SIZE - nbytes_removed; |
Z += new_gap_size; |
612 |
Z_BYTE += GAP_SIZE - nbytes_removed; |
Z_BYTE += new_gap_size; |
613 |
GAP_SIZE = nbytes_removed; |
GAP_SIZE = nbytes_removed; |
614 |
|
|
615 |
/* Move the unwanted pretend gap to the end of the buffer. This |
/* Move the unwanted pretend gap to the end of the buffer. This |
619 |
enlarge_buffer_text (current_buffer, -nbytes_removed); |
enlarge_buffer_text (current_buffer, -nbytes_removed); |
620 |
|
|
621 |
/* Now restore the desired gap. */ |
/* Now restore the desired gap. */ |
622 |
GAP_SIZE = old_gap_size - nbytes_removed; |
GAP_SIZE = new_gap_size; |
623 |
GPT = real_gap_loc; |
GPT = real_gap_loc; |
624 |
GPT_BYTE = real_gap_loc_byte; |
GPT_BYTE = real_gap_loc_byte; |
625 |
Z = real_Z; |
Z = real_Z; |
626 |
Z_BYTE = real_Z_byte; |
Z_BYTE = real_Z_byte; |
627 |
|
BEG_UNCHANGED = real_beg_unchanged; |
628 |
|
|
629 |
/* Put an anchor. */ |
/* Put an anchor. */ |
630 |
*(Z_ADDR) = 0; |
*(Z_ADDR) = 0; |