Eli Zaretskii writes: >> I think there's a case to be made for fixing this bug for Emacs 25.1. > > It depends on what the fix will look like. If it's simple and safe > enough, I'll agree. The following patch addresses the issue in my hands. I'd welcome confirmation. Stefan what do you think? You suggested something like this for Bug#22295 also. I think that the problem is the same; if I read insert-file-contents correctly, it disables collection of undo information. I may well be reading it wrong though. Given that this has turned up in two places now, it may be a wider problem, and the more general solution might be the better one. It might also invalidate the necessity for 12e009e52, but I haven't tested that yet. Alternatively, revert-buffer could just force undo-boundary. Phil