> Good, point so we just turn off undo during the dance and then insert > the single undo-element (this is only valid for non-REPLACE, of course). Hopefully for VISIT as well - we should not record deletions when handling the VISIT&REPLACE case. I see only three cases here: (1) undo-list was t => leave it alone. (2) nochange => restore undo-list to previous value. (3) otherwise => reset undo-list to nil. I also added a nochange arm for the non-decoding case - please have a look. BTW nochange makes an incompatible change to `revert-buffer': You can no longer use `revert-buffer' to get rid of the undo list. I think this should be documented somehow. Finally, we should document that REPLACE doesn't handle differences in text properties and tell users to write their own `revert-buffer-insert-file-contents-function' to handle them. martin, who still considers the non-VISIT&REPLACE case obscure and cannot see any "example" in `smerge-resolve'.