int new_s1;
if (!newgap)
- {
- if (unchanged_modified == MODIFF
- && overlay_unchanged_modified == OVERLAY_MODIFF)
- {
- beg_unchanged = charpos - BEG;
- end_unchanged = Z - charpos;
- }
- else
- {
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
- if (charpos < beg_unchanged)
- beg_unchanged = charpos - BEG;
- }
- }
+ BUF_COMPUTE_UNCHANGED (current_buffer, charpos, GPT);
i = GPT_BYTE;
to = GAP_END_ADDR;
register int i;
int new_s1;
- if (unchanged_modified == MODIFF
- && overlay_unchanged_modified == OVERLAY_MODIFF)
- {
- beg_unchanged = charpos - BEG;
- end_unchanged = Z - charpos;
- }
- else
- {
- if (Z - charpos - 1 < end_unchanged)
- end_unchanged = Z - charpos;
- if (GPT - BEG < beg_unchanged)
- beg_unchanged = GPT - BEG;
- }
+ BUF_COMPUTE_UNCHANGED (current_buffer, charpos, GPT);
i = GPT_BYTE;
from = GAP_END_ADDR;
}
/* As byte combining will decrease Z, we must check this again. */
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
+ if (Z - GPT < END_UNCHANGED)
+ END_UNCHANGED = Z - GPT;
CHECK_MARKERS ();
if (GPT_BYTE < GPT)
abort ();
- if (GPT - BEG < beg_unchanged)
- beg_unchanged = GPT - BEG;
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
+ if (GPT - BEG < BEG_UNCHANGED)
+ BEG_UNCHANGED = GPT - BEG;
+ if (Z - GPT < END_UNCHANGED)
+ END_UNCHANGED = Z - GPT;
if (GAP_SIZE < insbytes)
make_gap (insbytes - GAP_SIZE);
combine_bytes (from, from_byte, combined_before_bytes);
/* As byte combining will decrease Z, we must check this again. */
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
+ if (Z - GPT < END_UNCHANGED)
+ END_UNCHANGED = Z - GPT;
if (outgoing_insbytes == 0)
evaporate_overlays (from);
if (GPT_BYTE < GPT)
abort ();
- if (GPT - BEG < beg_unchanged)
- beg_unchanged = GPT - BEG;
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
+ if (GPT - BEG < BEG_UNCHANGED)
+ BEG_UNCHANGED = GPT - BEG;
+ if (Z - GPT < END_UNCHANGED)
+ END_UNCHANGED = Z - GPT;
if (combined_after_bytes)
{
record_insert (GPT - 1, 1);
- if (Z - GPT < end_unchanged)
- end_unchanged = Z - GPT;
+ if (Z - GPT < END_UNCHANGED)
+ END_UNCHANGED = Z - GPT;
}
CHECK_MARKERS ();
prepare_to_modify_buffer (start, end, NULL);
- if (start - 1 < beg_unchanged
- || (unchanged_modified == MODIFF
- && overlay_unchanged_modified == OVERLAY_MODIFF))
- beg_unchanged = start - 1;
- if (Z - end < end_unchanged
- || (unchanged_modified == MODIFF
- && overlay_unchanged_modified == OVERLAY_MODIFF))
- end_unchanged = Z - end;
+ BUF_COMPUTE_UNCHANGED (buffer, start - 1, end);
if (MODIFF <= SAVE_MODIFF)
record_first_change ();