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: Dan Espen
Subject: Re: Reverting but keeping undo
Date: Wed, 29 May 2013 09:25:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

>> >> FWIW, I just installed a patch in Emacs's trunk which makes that
>> >> revert-buffer doesn't discard undo history any more.
>> >
>> > Hm. So `revert-buffer' no longer removes undo? That has always been a
>> > part of what reverting means. And it is clearly intended in the code,
>> > not just an unfortunate accident or oversight.
>> 
>> I think it's a great change.
>>
>> > And why no discussion beforehand?
>
> Yes, why?  Any good reason?
>
>> > I can't think of a great reason why
>> > undo should *always* be removed as part of reverting (as it always has
>> > been). But just maybe there is a good reason for doing that, at least
>> > some or even most of the time. Why not give Richard et al the benefit
>> > of the doubt (30 years of "classic" reverting) and make undo removal
>> > optional, at least for a while? (Or is doubt a no-no?)
>> 
>> Are you, personally, asking for it to be customizable?
>
> Code and users should control whether to get the new behavior or the
> behavior they've had for the last 3 decades.  (Sure, users can add
> back code themselves to empty the undo list and get back the former
> behavior...)
>
>> What's your use case for throwing away the undo list?
>
> That's what reverting is about: returning to an initial state.  The
> undo list did not exist when the buffer was first visited - a new
> buffer has no undo.  Reverting generally means starting over from
> scratch - i.e., putting things in the same state they had at the
> outset (since the last save).
>
> Yes, there are some exceptions - some buffers have special reverting
> behavior.  And yes, we can define Emacs to be anything.  We can change
> what reverting means generally in Emacs, if we want.  But such a basic
> change calls for a little discussion at emacs-devel, don't you think?
>
> Maybe someone wants to keep some highlighting they applied in the
> buffer too, or keep some local variables, or...  A similar argument
> could be made for keeping all sorts of changes to the buffer state
> after "reversion".  But generally the way to make any such
> design/behavior change is to first propose and discuss in
> emacs-devel@gnu.org.
>
> There might well be someone out there who, "personally" or not (?),
> has (another) good argument for keeping things the way they were - at
> least as an option.  Who knows?  As Richard often says (especially for
> changes to basic, longstanding behavior), why not poll the users?
>
> Do you "personally" know that no one wants to drop the undo list when 
> reverting - whether interactively or in code?
>
> Don't you wonder that this came up now seemingly for the first time?
> Do you think that no one has thought before about whether the undo
> list should be kept or dropped when reverting?  A bit presumptuous,
> no?
>
> Give those who designed and first implemented buffers and buffer
> reverting the benefit of the doubt, at least to start with.  They were
> not necessarily right, but they were not obviously wrong, which is
> seemingly the way you look at it.  To you it is apparently a
> no-brainer that undo should not be dropped - how silly they were in
> the old days...
>
> Has something changed recently that suddenly makes the original design
> no longer appropriate?  What's new here?  Facebook?  Mobile apps?  The
> Kardashians?  Why should this behavior be changed now - why not
> before?
>
> Think about it a bit more.  Open it for discussion on emacs-devel.  Why act 
> so precipitously?  Is that "personally" necessary?

Reading through all that, I can only conclude that you can't think of
any reason why retaining undo history is bad.

Tradition or it used to work that way is ridiculous.

I can easily think of reasons why it's good.
I control compilation with file variables.
If I change the file variables, a revert makes Emacs aware of the new
values.  I certainly don't want to lose my undo history.

I say, great change.

-- 
Dan Espen


reply via email to

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