> I looked at the C code for insert-file-contents, and its handling of the > undo list looks pretty messy, it seems to be saving it and restoring > multiple times (sometimes nested?) using multiple methods of restoring > the old value.... ... which is messy because I tried to avoid that intermediate steps of the decoding process show up in the undo-list. Please try the attached patch.