On 14/06/2024 00:47, Dmitry Gutov wrote: > The thing is, decode_coding_c_string already calls > adjust_markers_for_insert through > >   decode_coding_object->decode_coding->produce_chars->insert_from_gap > > And the extra call moves the markers too far. > > Unfortunately, it's called with BEFORE_MARKERS=nil, and the above call > chain makes it difficult to pass through the extra argument. We can do it through the coding_system structure, though. See attached. It fixes the freezes in my testing. It seems like the least invasive possible fix, but better suggestions welcome.