help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reverting but keeping undo


From: Óscar Fuentes
Subject: Re: Reverting but keeping undo
Date: Thu, 30 May 2013 21:19:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> FWIW, I just installed a patch in Emacs's trunk which makes that
>> revert-buffer doesn't discard undo history any more.
>
> I wonder how that works.  Generally, the undo history belongs to a
> buffer content different from the content after reverting.  Does your
> patch prevent surprises like "undoing" changes that were never made to
> the newly read-in buffer content?

I have not tried the change introduced by Stefan, so my comments below
are just hypothetical.

Keeping undo history makes a lot of sense on this scenario:

1 Visit file
2 Edit
3 Save
3 Edit
4 Revert

It is obvious that the undo history created by step 3 is unusable, but
the part created by step 2 is useful. Until now, Emacs discardeded all
undo history.

What happens when the file is modified outside of Emacs? You migth end
with elements in the undo history which are out of sync with the file
contents. I don't know how Emacs behaves on those situations.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]