GNU bug report logs -
#23785
Emacs 25: "Undo" overdoes things.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 17 Jun 2016 15:03:01 UTC
Severity: normal
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>> 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.
>
> Indeed, the problem is not that insert-file-contents fails to add
> a boundary, but rather that it removes an existing one, so we should
> figure out where/why it removes it and change the code to push one back
> after removing it.
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.
>> Another possibility would be to have insert-file-contents call
>> "undo-auto--undoable-change" -- this is the root cause of the problem.
>
> Figuring out why undo-auto--undoable-change isn't called for it would be
> good as well, indeed. After all, it runs after-change-functions, so
> it should call undo-auto--undoable-change.
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.
I am somewhat guessing here.
Phil
This bug report was last modified 4 years and 261 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.