(CHECK_BYTE_COMBINING_FOR_INSERT): Call byte_combining_error.
(insert_from_string_1): Set *(GPT_ADDR) to 0 before calling
CHECK_BYTE_COMBINING_FOR_INSERT.
(insert_from_buffer_1): Likewise.
(adjust_after_replace): Check the posibility of inhibitted byte
combining correctly.
(replace_range): Before signaling an error for inhibitted byte
combining, recover the buffer in a safe state.
(del_range_2): Check the posibility of inhibitted byte combining
correctly.
combined_before_bytes and combined_after_bytes into account.
(count_combining_after): Handle the case that LENGTH is zero.
(adjust_after_replace): Record deletion at correct buffer
position. Handle the case that LEN is zero.
(replace_range): Record deletion at correct buffer position.
(del_range_2): Call adjust_makers_for_replace to adjust makers for
combined bytes.
(adjust_markers_for_replace): Correctly adjust marker positions.
Don't record these adjustment because they were recorded already.
(combine_bytes): Don't adjust markers here.
position if it is FROM.
(adjust_markers_for_combining): New function.
(combine_bytes): Call adjust_markers_for_combining instead of
adjust_markers_for_replace.
(adjust_after_replace): Record deletion of combining after bytes
with the correct position. Don't add combining bytes to the args
given to adjust_point. Handle correctly the case that there are
both before and after combining bytes.
(replace_range): Likewise. Record the actual deletion after
recoding deletions of combining bytes.
(adjust_after_replace): Arguments changed. Call
adjust_markers_for_replace if this function is called after
replacement.
(adjust_after_insert): New function.
(syms_of_insdel): Set up Lisp var.
(CHECK_MARKERS): New macro. Use it everywhere
instead of calling check_markers directly.
It tests check_markers_debug_flag.
(adjust_before_replace, adjust_after_replace, replace_range):
(del_range_2): Call record_delete the new way.
Use make_buffer_string_both to make the string to pass.
(adjust_markers_for_delete): Delete unused local coming_gap_size.
(adjust_markers_for_record_delete): New function.
(insert_1_both, insert_from_string_1, insert_from_buffer_1)
(adjust_after_replace, replace_range):
Use adjust_markers_for_record_delete.
(combine_bytes): Use the macro ADJUST_CHAR_POS.
(adjust_after_replace): New arg REPLACE. If it is zero, give LEN
as the arg LENGTH to offset_intervals.
(del_range_2): Give correct args to count_combining_before and
combine_bytes. Adjust the gap position after record_delete if
necessary. Give character position to adjust_overlays_for_delete.
(adjust_after_replace, replace_range):
Account for combining bytes in args to record_insert.
(del_range_2): Make undo records for combining bytes.
Put second call to move_gap_both before setting beg_unchanged.
adjust_overlays_for_delete.
(adjust_after_replace): Delete args COMBINED_BEFORE_BYTES and
COMBINED_AFTER_BYTES. This makes the newly generated text
following GPT_ADDR a buffer contents.
(insert_1_both, insert_from_string_1, insert_from_buffer_1):
Simplify greatly by using combine_bytes near the end
to handle all aspects of combining except for undo-recording.
This means most of the code deals with the text as if there were
no combining.
(replace_range): Likewise. Also handle unibyte-multibyte conversion
as in insert_from_string_1.
(del_range_2): Handle combining of character before the deletion
with strays after the deletion.
(adjust_markers_for_delete): Delete debugging code for Z == Z_BYTE.
(adjust_markers_for_insert): Move Z == Z_BYTE debugging code
to before we relocate the marker.
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.
New args COMBINED_AFTER_BYTES, COMBINED_BEFORE_BYTES. Calls changed.
(insert_1): Call insert_1_both.
(count_combining_before): New function.
(count_combining_after): New function.
(insert_1_both, insert_from_string_1): Handle bytes that combine
with chars adjacent to the inserted text.
(insert_from_buffer_1, replace_range): Likewise.
(adjust_after_replace): New args COMBINED_BEFORE_BYTES, COMBINED_AFTER_BYTES.
moved to charset.h.
(copy_text): Don't convert codes in the range 0200..0237 to
multibyte characters. For codes in the range 0240..0377, use
unibyte_char_to_multibyte.
(count_size_as_multibyte): Likewise.
(adjust_before_replace): Comment fixed.
(insert_from_string_1, insert_from_buffer_1): Use it.
(copy_text): New function.
(insert_from_buffer_1): Call copy_text to convert between
single-byte and multibyte text.
(insert_from_string_1): Likewise.
(insert_1_both): New function.
(insert_from_string): New args POS_BYTE, LENGTH.
(insert_from_string_before_markers):
(insert_from_string_1): New arg POS_BYTE. Swap args NCHARS, NBYTES.
Don't fail to use POS_BYTE!
(insert_from_buffer_1): Get both inschars and insbytes from NEW.