On Sat, June 18, 2016 8:52 pm, Stefan Monnier wrote: >> My concern is not with the behavior the proposed change intends to get >> us, the concern is with the unintended consequences of the change. At >> this late stage, I'd like to keep the risk of unintended consequences to >> the minimum, unless we want this change so badly we agree to extend the >> pretesting by another month or two. > > Yes, that's the other side of the coin, indeed. Attached are another two patches which also solve the issue. One adds an undo boundary specifically in revert-buffer. Works but is questionable in that revert-buffer is pluggable -- it can call any function, other than the default. The other fiddles with insert-file-contents and adds an undo. It is this function that has specialized handling for the undo list that is causing the problem. My patch in this case is questionable in that I have randomly pushed a call to undo-boundary near the end. It should probably be somewere better. Another possibility would be to have insert-file-contents call "undo-auto--undoable-change" -- this is the root cause of the problem. Changes are happening. Also attached is a test case which demonstrates the problem. So many possibilities!