all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: help-gnu-emacs@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: RE: Reverting but keeping undo
Date: Tue, 28 May 2013 22:13:12 -0700 (PDT)	[thread overview]
Message-ID: <92f42e8d-b6a8-4f2e-bd1d-c717f1ea9dd0@default> (raw)
In-Reply-To: <8738t6tqie.fsf@yandex.ru>

> >> 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?



  reply	other threads:[~2013-05-29  5:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15 10:38 Reverting but keeping undo Óscar Fuentes
2013-05-16  5:29 ` W. Greenhouse
2013-05-16 15:10   ` Óscar Fuentes
2013-05-29  1:52 ` Stefan Monnier
2013-05-29  3:09   ` Drew Adams
2013-05-29  3:27     ` Dmitry Gutov
2013-05-29  5:13       ` Drew Adams [this message]
2013-05-29 12:26         ` Dmitry Gutov
2013-05-29 13:55           ` Drew Adams
2013-05-29 15:21             ` Dmitry Gutov
2013-05-29 16:33               ` Drew Adams
2013-05-29 17:51                 ` Dmitry Gutov
     [not found]               ` <mailman.605.1369845207.22516.help-gnu-emacs@gnu.org>
2013-05-29 18:42                 ` Dan Espen
2013-05-29 13:48         ` Stefan Monnier
     [not found]       ` <mailman.562.1369804408.22516.help-gnu-emacs@gnu.org>
2013-05-29 13:25         ` Dan Espen
2013-05-29 16:26           ` Drew Adams
2013-05-30 18:48           ` Michael Heerdegen
2013-05-30 18:41   ` Michael Heerdegen
2013-05-30 19:19     ` Óscar Fuentes
2013-05-30 21:26     ` Stefan Monnier
2013-05-30 22:05       ` Michael Heerdegen
     [not found]       ` <mailman.728.1369951538.22516.help-gnu-emacs@gnu.org>
2013-05-30 23:59         ` Dan Espen
2013-05-31  0:58           ` Stefan Monnier
     [not found]           ` <mailman.738.1369961954.22516.help-gnu-emacs@gnu.org>
2013-05-31  1:21             ` Dan Espen
2013-05-31  2:28               ` Drew Adams
2013-05-31 16:05           ` Michael Heerdegen
2013-05-31 18:29             ` Óscar Fuentes
     [not found]           ` <mailman.767.1370016367.22516.help-gnu-emacs@gnu.org>
2013-05-31 17:22             ` Dan Espen
2013-05-31 18:08               ` Barry Margolin
     [not found]   ` <mailman.699.1369939338.22516.help-gnu-emacs@gnu.org>
2013-05-30 18:45     ` Barry Margolin
  -- strict thread matches above, loose matches on Subject: below --
2013-05-31 16:49 Barry OReilly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92f42e8d-b6a8-4f2e-bd1d-c717f1ea9dd0@default \
    --to=drew.adams@oracle.com \
    --cc=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.