Subject: bug#23785: Emacs 25: 'Undo' overdoes things.

From: Stefan Monnier <[email-masked]>
Date: Mon, 20 Jun 2016 10:04:01 -0400

> I don't understand why you say this. AFAICT, the problem is that the
> buffer-undo-list doesn't have a nil after the command has happened.

Hmm... I thought I had seen a trace showing that there was a nil before
the revert-buffer that then disappeared.  But it looks like
I misremember.  Sorry.

> I think that it does -- it calls "insert_from_buffer" which then calls
> "prepare_to_modify_buffer".
> I *think* what is happening is that prepare_to_modify_buffer is being
> called when buffer-undo-list is specbound to t -- hence the change does
> not register as undoable change.

That would be a good explanation, indeed.  So I guess your patch is the
right fix.  Thank you.

        Stefan