- combined_before_bytes
- = count_combining_before (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE);
- combined_after_bytes
- = count_combining_after (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE);
-
- /* Record deletion of the surrounding text that combines with
- the insertion. This, together with recording the insertion,
- will add up to the right stuff in the undo list.
-
- But there is no need to actually delete the combining bytes
- from the buffer and reinsert them. */
-
- if (combined_after_bytes)
- {
- deletion = make_buffer_string_both (PT, PT_BYTE,
- PT + combined_after_bytes,
- PT_BYTE + combined_after_bytes, 1);
-
- adjust_markers_for_record_delete (PT, PT_BYTE,
- PT + combined_after_bytes,
- PT_BYTE + combined_after_bytes);
- record_delete (PT, deletion);
- }
-
- if (combined_before_bytes)
- {
- deletion = make_buffer_string_both (PT - 1, CHAR_TO_BYTE (PT - 1),
- PT, PT_BYTE, 1);
- adjust_markers_for_record_delete (PT - 1, CHAR_TO_BYTE (PT - 1),
- PT, PT_BYTE);
- record_delete (PT - 1, deletion);
- }
-
- record_insert (PT - !!combined_before_bytes,
- nchars - combined_before_bytes + !!combined_before_bytes);