unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Reverting but keeping undo
@ 2013-05-15 10:38 Óscar Fuentes
  2013-05-16  5:29 ` W. Greenhouse
  2013-05-29  1:52 ` Stefan Monnier
  0 siblings, 2 replies; 31+ messages in thread
From: Óscar Fuentes @ 2013-05-15 10:38 UTC (permalink / raw)
  To: help-gnu-emacs

`revert-buffer' discards undo history. I can understand that undo
history might be in conflict with the new contents of the buffer. How
dangerous is that? Apart from that, what could be wrong with using the
recipe published in

http://www.emacswiki.org/emacs/RevertBuffer#toc4

?

For your convenience, this is the recipe:

(defun revert-buffer-keep-undo (&rest -)
  "Revert buffer but keep undo history."
  (interactive)
  (let ((inhibit-read-only t))
    (erase-buffer)
    (insert-file-contents (buffer-file-name))
    (set-visited-file-modtime (visited-file-modtime))
    (set-buffer-modified-p nil)))

Install in command ‘revert-buffer’ with

  (setq revert-buffer-function 'revert-buffer-keep-undo)




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  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
  1 sibling, 1 reply; 31+ messages in thread
From: W. Greenhouse @ 2013-05-16  5:29 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Óscar Fuentes <ofv-39ZsbGIQGT7e5aOfsHch1g@public.gmane.org> writes:

> `revert-buffer' discards undo history. I can understand that undo
> history might be in conflict with the new contents of the buffer. How
> dangerous is that? Apart from that, what could be wrong with using the
> recipe published in
>
> http://www.emacswiki.org/emacs/RevertBuffer#toc4
>
> ?
>
> For your convenience, this is the recipe:
>
> (defun revert-buffer-keep-undo (&rest -)
>   "Revert buffer but keep undo history."
>   (interactive)
>   (let ((inhibit-read-only t))
>     (erase-buffer)
>     (insert-file-contents (buffer-file-name))
>     (set-visited-file-modtime (visited-file-modtime))
>     (set-buffer-modified-p nil)))
>
> Install in command ‘revert-buffer’ with
>
>   (setq revert-buffer-function 'revert-buffer-keep-undo)

This looks like a nice simple hack, but it doesn't do half of the things
that revert-buffer does, such as resetting local variables and possibly
picking a different major mode and file encoding if the change in file
contents warrants it.  From looking at the code of `revert-buffer', this
problem could be solved without getting rid of all those nice features
if you put an advice around revert-buffer that stashed
`buffer-undo-list' away inside a let-bound variable before revertying,
and then reset `buffer-undo-list' from that variable afterwards.

-- 
BOFH excuse #453:

Spider infestation in warm case parts




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-16  5:29 ` W. Greenhouse
@ 2013-05-16 15:10   ` Óscar Fuentes
  0 siblings, 0 replies; 31+ messages in thread
From: Óscar Fuentes @ 2013-05-16 15:10 UTC (permalink / raw)
  To: help-gnu-emacs

wgreenhouse@riseup.net (W. Greenhouse)
writes:

> From looking at the code of `revert-buffer', this
> problem could be solved without getting rid of all those nice features
> if you put an advice around revert-buffer that stashed
> `buffer-undo-list' away inside a let-bound variable before revertying,
> and then reset `buffer-undo-list' from that variable afterwards.

Interesting, I'll try it.

Thank you.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-15 10:38 Reverting but keeping undo Óscar Fuentes
  2013-05-16  5:29 ` W. Greenhouse
@ 2013-05-29  1:52 ` Stefan Monnier
  2013-05-29  3:09   ` Drew Adams
                     ` (2 more replies)
  1 sibling, 3 replies; 31+ messages in thread
From: Stefan Monnier @ 2013-05-29  1:52 UTC (permalink / raw)
  To: help-gnu-emacs

> `revert-buffer' discards undo history.

FWIW, I just installed a patch in Emacs's trunk which makes that
revert-buffer doesn't discard undo history any more.


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  2013-05-29  1:52 ` Stefan Monnier
@ 2013-05-29  3:09   ` Drew Adams
  2013-05-29  3:27     ` Dmitry Gutov
  2013-05-30 18:41   ` Michael Heerdegen
       [not found]   ` <mailman.699.1369939338.22516.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 31+ messages in thread
From: Drew Adams @ 2013-05-29  3:09 UTC (permalink / raw)
  To: Stefan Monnier, help-gnu-emacs

> > `revert-buffer' discards undo history.
> 
> 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.

If some code or user has a use for not removing undo, fine.  But why not make this removal optional, controlled, e.g., by a variable or a parameter?  Why willy nilly remove something clearly intended from the beginning to be an integral part of reverting (at least by default)?

And why no discussion beforehand?  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?)

Let's not forget either that `revert-buffer' is used both in code and interactively.  Those two uses are sometimes quite different.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29  3:09   ` Drew Adams
@ 2013-05-29  3:27     ` Dmitry Gutov
  2013-05-29  5:13       ` Drew Adams
       [not found]       ` <mailman.562.1369804408.22516.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 31+ messages in thread
From: Dmitry Gutov @ 2013-05-29  3:27 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Stefan Monnier

Drew Adams <drew.adams@oracle.com> writes:
>> > `revert-buffer' discards undo history.
>> 
>> 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? 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? What's your use
case for throwing away the undo list?



^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  2013-05-29  3:27     ` Dmitry Gutov
@ 2013-05-29  5:13       ` Drew Adams
  2013-05-29 12:26         ` Dmitry Gutov
  2013-05-29 13:48         ` Stefan Monnier
       [not found]       ` <mailman.562.1369804408.22516.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 31+ messages in thread
From: Drew Adams @ 2013-05-29  5:13 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs, Stefan Monnier

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



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29  5:13       ` Drew Adams
@ 2013-05-29 12:26         ` Dmitry Gutov
  2013-05-29 13:55           ` Drew Adams
  2013-05-29 13:48         ` Stefan Monnier
  1 sibling, 1 reply; 31+ messages in thread
From: Dmitry Gutov @ 2013-05-29 12:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

On 29.05.2013 9:13, Drew Adams wrote:
>> I think it's a great change.
>>
> Yes, why?  Any good reason?

The obvious one: prevention of data loss. With `auto-revert-mode', for 
example.

> (Sure, users can add back code themselves to empty the undo list and get back the former behavior...)

Indeed, they can. The reverse has been impossible, until now.

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

They should be able to speak up now, or during the pretest. Nothing is 
really set in stone, when it comes to 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?

Obviously not. The opened bug is a couple of years old now.

> Think about it a bit more.  Open it for discussion on emacs-devel.  Why act so precipitously?  Is that "personally" necessary?

We're having this discussion now, and instead of giving actual reasons 
you're speaking of hypothetical users.

Talking about personal needs and requirements is good, because every 
person is usually competent about those.

But the way you often assume the you know the userbase better than 
everyone else is tiresome, to be honest.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [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
  0 siblings, 2 replies; 31+ messages in thread
From: Dan Espen @ 2013-05-29 13:25 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29  5:13       ` Drew Adams
  2013-05-29 12:26         ` Dmitry Gutov
@ 2013-05-29 13:48         ` Stefan Monnier
  1 sibling, 0 replies; 31+ messages in thread
From: Stefan Monnier @ 2013-05-29 13:48 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams wrote:
>> > And why no discussion beforehand?
Drew Adams wrote:
> Yes, why?  Any good reason?

I see there are enough Drew Adams that they can discuss this among themselves.


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  2013-05-29 12:26         ` Dmitry Gutov
@ 2013-05-29 13:55           ` Drew Adams
  2013-05-29 15:21             ` Dmitry Gutov
  0 siblings, 1 reply; 31+ messages in thread
From: Drew Adams @ 2013-05-29 13:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs

> >> I think it's a great change.
> >>
> > Yes, why?  Any good reason?

You misquoted.  My "why" there was about the lack of discussion prior to this change - why no discussion?  You make it sound like I asked why you thought this was a great change.  Dishonest or an innocent mistake?  This is what you should have quoted:

DG> > I think it's a great change.
da> > > And why no discussion beforehand?
da> Yes, why?  Any good reason?

> > 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?
> 
> They should be able to speak up now, or during the pretest. Nothing is
> really set in stone, when it comes to code.

That is not a poll of users.  And it is not a discusson on emacs-devel by Emacs developers.

Instead of willy nilly changing the basic function `revert-buffer', this feature of extra protection against user mistakes (including mistakenly confirming reversion!) should be implemented by creating a separate command or user variable (perhaps option) - giving users the choice to use it or not.  If `auto-revert-mode' is also implicated then it can be made sensitive to the same (or an additional) user choice.

> > 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?
> 
> Obviously not. The opened bug is a couple of years old now.

There are thousands of bugs that have been open for a couple of years or more.  That means nothing.

> > Think about it a bit more.  Open it for discussion on emacs-devel.  Why
> > act so precipitously?  Is that "personally" necessary?
> 
> We're having this discussion now, and instead of giving actual reasons
> you're speaking of hypothetical users.

I gave reasons.  1. This is what reverting means, what reverting does (should do, always has done).  2. `revert-buffer' is not used only interactively; it is a basic function used in lots of code.  3. Users should have a choice (individually).

This is like the trash/recycle bin that was added not too long ago.  We didn't just redefine `delete-file' so that it always moves files to the bin, did we?  Why not?

> Talking about personal needs and requirements is good, because every
> person is usually competent about those.
> 
> But the way you often assume the you know the userbase better than
> everyone else is tiresome, to be honest.

I'm not the one assuming anything about the user base.  I'm not the one claiming competence deciding what is good for everyone.   I'm not imposing any change on the existing behavior.  My only assumption about the user base is that users deserve control, choice.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29 13:55           ` Drew Adams
@ 2013-05-29 15:21             ` Dmitry Gutov
  2013-05-29 16:33               ` Drew Adams
       [not found]               ` <mailman.605.1369845207.22516.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 31+ messages in thread
From: Dmitry Gutov @ 2013-05-29 15:21 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

On 29.05.2013 17:55, Drew Adams wrote:
>>>> I think it's a great change.
>>>>
>>> Yes, why?  Any good reason?
>
> You misquoted.  My "why" there was about the lack of discussion prior to this change - why no discussion?

Who were you agreeing with, there?

> DG> > I think it's a great change.
> da> > > And why no discussion beforehand?
> da> Yes, why?  Any good reason?

Because discussing every single thing takes more time and effort, and 
most people have a limited amount of them. It's not like you're 
sponsoring the development, right?

And, like it often happens, people with a lot of opinions are often the 
least qualified to make a decision. See "bikeshedding".

> And it is not a discusson on emacs-devel by Emacs developers.

Again, are you an Emacs developer? You aren't. What do you care?

Emacs committers are subscribed to emacs-diff or emacs-bugs, and if some 
aren't, they should. Anyone disagreeing can voice their opinion. 
Preferably without speaking for other people.

> Instead of willy nilly changing the basic function `revert-buffer', this feature of extra protection against user mistakes (including mistakenly confirming reversion!) should be implemented by creating a separate command or user variable (perhaps option) - giving users the choice to use it or not.  If `auto-revert-mode' is also implicated then it can be made sensitive to the same (or an additional) user choice.

The "extra protection" feature means that the new behavior makes sense 
as default.

So, a hypothetical new variable would revert the behavior to how it were 
before, but setting a new variable isn't too different from advising 
`revert-buffer', from a user's perspective.

>> Obviously not. The opened bug is a couple of years old now.
>
> There are thousands of bugs that have been open for a couple of years or more.  That means nothing.

That means someone has spent some time thinking, and then made a decision.

>> We're having this discussion now, and instead of giving actual reasons
>> you're speaking of hypothetical users.
>
> I gave reasons.  1. This is what reverting means, what reverting does (should do, always has done).

"foo has always done that" is not a reason. Here's an example of a 
plausible reason "Mary has a little lamb, she wants to shave it, but 
cannot do it unless `revert-buffer' clears the buffer undo list." Here's 
another: "foo has always done that, and the new behavior breaks packages 
X, Y and Z that depend on it".

"reverting means" whatever the user manual at any given point says it means.

> 2. `revert-buffer' is not used only interactively; it is a basic function used in lots of code.

Another reason to make the change. Basic functions shouldn't do too many 
things at once. If a consumer wants to clear the undo list, they can do 
that separately.

>> But the way you often assume the you know the userbase better than
>> everyone else is tiresome, to be honest.
>
> I'm not the one assuming anything about the user base.  I'm not the one claiming competence deciding what is good for everyone.   I'm not imposing any change on the existing behavior.  My only assumption about the user base is that users deserve control, choice.

You're assuming that the old behavior is important enough for a decent 
amount of users to justify the expense of discussing it, adding a 
separate command, new variable, whatever, documenting it, and then 
maintaining these additions over the years. That's not a safe assumption.

And the one user with special needs who does care about it can change 
the behavior with `defadvice'.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  2013-05-29 13:25         ` Dan Espen
@ 2013-05-29 16:26           ` Drew Adams
  2013-05-30 18:48           ` Michael Heerdegen
  1 sibling, 0 replies; 31+ messages in thread
From: Drew Adams @ 2013-05-29 16:26 UTC (permalink / raw)
  To: Dan Espen, help-gnu-emacs

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

I've already said that I think it is good for users to be able to hold onto undo history when reverting.  Be _able_ to.

As a matter of fact, as one user, I have used this feature for quite a while, ever since the original post of the code (command `revert-buffer-keep-undo') on Emacs Wiki.

What should have been discussed, and is not necessarily a good change, is replacing `revert-buffer' with this behavior, useful as it might be and preferred as it might be for interactive use by some users (including me).




^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  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>
  1 sibling, 1 reply; 31+ messages in thread
From: Drew Adams @ 2013-05-29 16:33 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs

> > why no discussion?
> 
> Who were you agreeing with, there?

Agreeing with?  It's a question.

> Because discussing every single thing takes more time and effort, and
> most people have a limited amount of them. It's not like you're
> sponsoring the development, right?
> 
> And, like it often happens, people with a lot of opinions are often the
> least qualified to make a decision. See "bikeshedding".

Doesn't matter.  It would have been better to open the proposal for
discussion.  There was a discussion about adding remove-to-trash-bin
behavior, for instance, and that feature did not even _replace_ the
existing file-deletion behavior.

Those offering opinions are not, in general, those deciding.  Discussing
is not the same thing as deciding.  Discussion is not and should not be
limited to only those who decide, or even to only those who are most
qualified.

Just because someone qualified will decide does not mean that there should
be no discussion before the decision, including contributions by those you
might judge "least qualified".

> > And it is not a discusson on emacs-devel by Emacs developers.
> 
> Again, are you an Emacs developer? You aren't. What do you care?

That remark bespeaks an arrogant attitude toward Emacs users.

Lots of Emacs users care about the development of Emacs.
They do not need to justify such care to anyone, including to you.

> Emacs committers are subscribed to emacs-diff or emacs-bugs, and if some
> aren't, they should. Anyone disagreeing can voice their opinion.
> Preferably without speaking for other people.

Blah.

> > Instead of willy nilly changing the basic function `revert-buffer',
> > this feature of extra protection against user mistakes (including
> > mistakenly confirming reversion!) should be implemented by creating
> > a separate command or user variable (perhaps option) - giving users
> > the choice to use it or not.  If `auto-revert-mode' is also implicated
> > then it can be made sensitive to the same (or an additional) user choice.
> 
> The "extra protection" feature means that the new behavior makes sense
> as default.

Maybe so.  But it was not made the _default_ behavior.  It was made _the_
behavior - more than just the default.  The new behavior replaces the old.

> So, a hypothetical new variable would revert the behavior to how it were
> before, but setting a new variable isn't too different from advising
> `revert-buffer', from a user's perspective.

It's a lot different.  You should know that.

> > I'm not the one assuming anything about the user base.  I'm not the one
> > claiming competence deciding what is good for everyone.   I'm not
> > imposing any change on the existing behavior.  My only assumption about
> > the user base is that users deserve control, choice.
> 
> You're assuming that the old behavior is important enough

...that a change should be proposed and open for discussion on the dev list.
That's all.

> for a decent amount of users to justify the expense of discussing it,
> adding a separate command, new variable, whatever, documenting it, and
> then maintaining these additions over the years. That's not a safe
> assumption.

No, I don't assume any of that.  I just think this should have been proposed
for discussion on the dev list, so we might hear from people with different
uses and more knowledge (than I have, at least).  Instead, we just get a few
knee-jerk reactions of "I like it!" on the help list.

Well, FWIW, I happen to like it too, for my personal interactive use.
And FWIW I have been using it for quite a while now.  Surprised?

I'm just not sure it is a great idea for Emacs (i.e., all users) as an
unconditional _replacement_ behavior.  That's all.  Unqualified to judge,
no doubt.  But would like to have heard from more, including some who are
qualified.

Can I be clearer?  I am not saying this change should not be made.
I'm saying I don't know whether it should be made, and there was no
discussion about it, which is too bad.  Discussion might have made any
issues clear, perhaps boosting confidence in the decision.

Even for minor changes we often see "Any objections?" in the dev list.
That's a courtesy, but it is also a safeguard to some extent.  This change
was not even brought up.

I asked why.  Your answer was that this is an unimportant, uncontroversial
change not worth remarking or discussing.  To you, discussion of this
would be bikeshedding.  I am not so sure as you.

> And the one user with special needs who does care about it can change
> the behavior with `defadvice'.

Wunderbar.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29 16:33               ` Drew Adams
@ 2013-05-29 17:51                 ` Dmitry Gutov
  0 siblings, 0 replies; 31+ messages in thread
From: Dmitry Gutov @ 2013-05-29 17:51 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

On 29.05.2013 20:33, Drew Adams wrote:
>>> And it is not a discusson on emacs-devel by Emacs developers.
>>
>> Again, are you an Emacs developer? You aren't. What do you care?
>
> That remark bespeaks an arrogant attitude toward Emacs users.

Again, you're missing the point. It's meaningless for you to complain 
that there was no discussion by Emacs developers. If any of the 
developers feel that it should be discussed, they can say that themselves.

>> So, a hypothetical new variable would revert the behavior to how it were
>> before, but setting a new variable isn't too different from advising
>> `revert-buffer', from a user's perspective.
>
> It's a lot different.  You should know that.

Not really, in this case. Undo list is a technical detail, and the 
advice facility is meant for technical users. That's just my opinion, 
though.

> No, I don't assume any of that.  I just think this should have been proposed
> for discussion on the dev list, so we might hear from people with different
> uses and more knowledge (than I have, at least).

Do you think they're too shy to speak up now?

> Well, FWIW, I happen to like it too, for my personal interactive use.
> And FWIW I have been using it for quite a while now.  Surprised?

Not at all. That's exactly my point. You like it, you don't know anyone 
how doesn't, yet you still think people are doing things wrong.

> I asked why.  Your answer was that this is an unimportant, uncontroversial
> change not worth remarking or discussing.  To you, discussion of this
> would be bikeshedding.  I am not so sure as you.

The discussion would have been important if anyone had some important 
practical points to bring up. Which, again, you haven't.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [not found]               ` <mailman.605.1369845207.22516.help-gnu-emacs@gnu.org>
@ 2013-05-29 18:42                 ` Dan Espen
  0 siblings, 0 replies; 31+ messages in thread
From: Dan Espen @ 2013-05-29 18:42 UTC (permalink / raw)
  To: help-gnu-emacs

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

>> > why no discussion?
>> 
>> Who were you agreeing with, there?
>
> Agreeing with?  It's a question.
>
>> Because discussing every single thing takes more time and effort, and
>> most people have a limited amount of them. It's not like you're
>> sponsoring the development, right?
>> 
>> And, like it often happens, people with a lot of opinions are often the
>> least qualified to make a decision. See "bikeshedding".
>
> Doesn't matter.  It would have been better to open the proposal for
> discussion.  There was a discussion about adding remove-to-trash-bin
> behavior, for instance, and that feature did not even _replace_ the
> existing file-deletion behavior.
>
> Those offering opinions are not, in general, those deciding.  Discussing
> is not the same thing as deciding.  Discussion is not and should not be
> limited to only those who decide, or even to only those who are most
> qualified.
>
> Just because someone qualified will decide does not mean that there should
> be no discussion before the decision, including contributions by those you
> might judge "least qualified".
>
>> > And it is not a discusson on emacs-devel by Emacs developers.
>> 
>> Again, are you an Emacs developer? You aren't. What do you care?
>
> That remark bespeaks an arrogant attitude toward Emacs users.
>
> Lots of Emacs users care about the development of Emacs.
> They do not need to justify such care to anyone, including to you.
>
>> Emacs committers are subscribed to emacs-diff or emacs-bugs, and if some
>> aren't, they should. Anyone disagreeing can voice their opinion.
>> Preferably without speaking for other people.
>
> Blah.
>
>> > Instead of willy nilly changing the basic function `revert-buffer',
>> > this feature of extra protection against user mistakes (including
>> > mistakenly confirming reversion!) should be implemented by creating
>> > a separate command or user variable (perhaps option) - giving users
>> > the choice to use it or not.  If `auto-revert-mode' is also implicated
>> > then it can be made sensitive to the same (or an additional) user choice.
>> 
>> The "extra protection" feature means that the new behavior makes sense
>> as default.
>
> Maybe so.  But it was not made the _default_ behavior.  It was made _the_
> behavior - more than just the default.  The new behavior replaces the old.
>
>> So, a hypothetical new variable would revert the behavior to how it were
>> before, but setting a new variable isn't too different from advising
>> `revert-buffer', from a user's perspective.
>
> It's a lot different.  You should know that.
>
>> > I'm not the one assuming anything about the user base.  I'm not the one
>> > claiming competence deciding what is good for everyone.   I'm not
>> > imposing any change on the existing behavior.  My only assumption about
>> > the user base is that users deserve control, choice.
>> 
>> You're assuming that the old behavior is important enough
>
> ...that a change should be proposed and open for discussion on the dev list.
> That's all.
>
>> for a decent amount of users to justify the expense of discussing it,
>> adding a separate command, new variable, whatever, documenting it, and
>> then maintaining these additions over the years. That's not a safe
>> assumption.
>
> No, I don't assume any of that.  I just think this should have been proposed
> for discussion on the dev list, so we might hear from people with different
> uses and more knowledge (than I have, at least).  Instead, we just get a few
> knee-jerk reactions of "I like it!" on the help list.
>
> Well, FWIW, I happen to like it too, for my personal interactive use.
> And FWIW I have been using it for quite a while now.  Surprised?
>
> I'm just not sure it is a great idea for Emacs (i.e., all users) as an
> unconditional _replacement_ behavior.  That's all.  Unqualified to judge,
> no doubt.  But would like to have heard from more, including some who are
> qualified.
>
> Can I be clearer?  I am not saying this change should not be made.
> I'm saying I don't know whether it should be made, and there was no
> discussion about it, which is too bad.  Discussion might have made any
> issues clear, perhaps boosting confidence in the decision.
>
> Even for minor changes we often see "Any objections?" in the dev list.
> That's a courtesy, but it is also a safeguard to some extent.  This change
> was not even brought up.
>
> I asked why.  Your answer was that this is an unimportant, uncontroversial
> change not worth remarking or discussing.  To you, discussion of this
> would be bikeshedding.  I am not so sure as you.
>
>> And the one user with special needs who does care about it can change
>> the behavior with `defadvice'.
>
> Wunderbar.

I think most of us are wondering what the hell you're going on about.
You made your comments.  You got replies.  Yet you complain about
lack of discussion.

If there is someone else you want to discuss this with, seek them out.

Meanwhile, no one is going to put you in charge of mailing list
protocol.  What do you want to do, impose a fine because you didn't
get a "Any objections?" comment?

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29  1:52 ` Stefan Monnier
  2013-05-29  3:09   ` Drew Adams
@ 2013-05-30 18:41   ` Michael Heerdegen
  2013-05-30 19:19     ` Óscar Fuentes
  2013-05-30 21:26     ` Stefan Monnier
       [not found]   ` <mailman.699.1369939338.22516.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 31+ messages in thread
From: Michael Heerdegen @ 2013-05-30 18:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > `revert-buffer' discards undo history.
>
> 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?

Reading all of this thread, there were very few arguments about the
subject itself.  Which advantage does this change offer?  Just curious.


Regards,

Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [not found]   ` <mailman.699.1369939338.22516.help-gnu-emacs@gnu.org>
@ 2013-05-30 18:45     ` Barry Margolin
  0 siblings, 0 replies; 31+ messages in thread
From: Barry Margolin @ 2013-05-30 18:45 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.699.1369939338.22516.help-gnu-emacs@gnu.org>,
 Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > > `revert-buffer' discards undo history.
> >
> > 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?

Maybe the first thing in the undo history is the revert itself. So when 
you undo, you get back the version of the buffer before reverting, and 
further undoes then operate on that content.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-29 13:25         ` Dan Espen
  2013-05-29 16:26           ` Drew Adams
@ 2013-05-30 18:48           ` Michael Heerdegen
  1 sibling, 0 replies; 31+ messages in thread
From: Michael Heerdegen @ 2013-05-30 18:48 UTC (permalink / raw)
  To: Dan Espen; +Cc: help-gnu-emacs

Hi Dan,

I'm neither for nor against this change, but try to understand why it's
good, once we discuss it here.

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

I can think of one: inconsistency.  Generally, the undo history doesn't
belong to the newly read-in content.  It makes sense to throw away
an undo history if the buffer content is thrown away as well and
replaced by the saved file content (which can be anything).

What do I miss?

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

This is what `normal-mode' is for.  No reason to revert the buffer for
that.

Are there other reasons?


Regards,

Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-30 18:41   ` Michael Heerdegen
@ 2013-05-30 19:19     ` Óscar Fuentes
  2013-05-30 21:26     ` Stefan Monnier
  1 sibling, 0 replies; 31+ messages in thread
From: Óscar Fuentes @ 2013-05-30 19:19 UTC (permalink / raw)
  To: help-gnu-emacs

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.




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  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>
  1 sibling, 2 replies; 31+ messages in thread
From: Stefan Monnier @ 2013-05-30 21:26 UTC (permalink / raw)
  To: help-gnu-emacs

> I wonder how that works.

The revert is considered as a change like any other.
I.e. the first undo step simply undoes the buffer modifications introduced by
the revert.


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  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>
  1 sibling, 0 replies; 31+ messages in thread
From: Michael Heerdegen @ 2013-05-30 22:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > I wonder how that works.
>
> The revert is considered as a change like any other.  I.e. the first
> undo step simply undoes the buffer modifications introduced by the
> revert.

That sounds good, thanks.

I wonder, however, if the user will notice when he passes that point
while successively undoing.  I.e., for the case the user doesn't want to
undo prior reverts, maybe there could be some kind of warning in the
minibuffer.


Regards,

Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [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
                             ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Dan Espen @ 2013-05-30 23:59 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> > I wonder how that works.
>>
>> The revert is considered as a change like any other.  I.e. the first
>> undo step simply undoes the buffer modifications introduced by the
>> revert.
>
> That sounds good, thanks.
>
> I wonder, however, if the user will notice when he passes that point
> while successively undoing.  I.e., for the case the user doesn't want to
> undo prior reverts, maybe there could be some kind of warning in the
> minibuffer.

Another warning?

First Stefan for the explanation.

Undoing a revert sounds very intuitive to me.
The fact that it was missing before was sort of dangerous.

And the confirmation dialog on the revert was no fun,
I had my own solution for bypassing the warning.

I see no reason for any additional warnings.
If you can undo revert, the natural assumption should be that
you can keep doing undo.

I assume this change kills off the old confirmation about reverting.
(Posting from news:gnu.emacs.help).


-- 
Dan Espen


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  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>
                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 31+ messages in thread
From: Stefan Monnier @ 2013-05-31  0:58 UTC (permalink / raw)
  To: help-gnu-emacs

> I assume this change kills off the old confirmation about reverting.

No, it doesn't.  I never made the connection between the two in
my mind.  But I think you're on to something.

FWIW, here's what I use for the revert-buffer confirmation:

(advice-add 'revert-buffer :before
            (lambda (&rest _)
              (interactive (list (not current-prefix-arg)
                                 ;; Don't request confirmation if the
                                 ;; user just hit M-x revert-buffer RET.
                                 (eq last-command-event ?\r)))
              nil))


-- Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [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
  0 siblings, 1 reply; 31+ messages in thread
From: Dan Espen @ 2013-05-31  1:21 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I assume this change kills off the old confirmation about reverting.
>
> No, it doesn't.  I never made the connection between the two in
> my mind.  But I think you're on to something.
>
> FWIW, here's what I use for the revert-buffer confirmation:
>
> (advice-add 'revert-buffer :before
>             (lambda (&rest _)
>               (interactive (list (not current-prefix-arg)
>                                  ;; Don't request confirmation if the
>                                  ;; user just hit M-x revert-buffer RET.
>                                  (eq last-command-event ?\r)))
>               nil))

Sorry for the previous typo which I just noticed, I meant to type:

"First Stefan thanks for the explanation."

I just used:

(defun my-revert()
  (interactive)
  (message "Reverting buffer from %s" buffer-file-name)
  (revert-buffer nil 1)
  (message "Done"))

and bound it to a key.


With undo for reverts, I can't think of a good reason for the
confirmation.  Some kind of notice in the mini buffer is still
a good idea.


-- 
Dan Espen


^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: Reverting but keeping undo
  2013-05-31  1:21             ` Dan Espen
@ 2013-05-31  2:28               ` Drew Adams
  0 siblings, 0 replies; 31+ messages in thread
From: Drew Adams @ 2013-05-31  2:28 UTC (permalink / raw)
  To: Dan Espen, help-gnu-emacs

> (defun my-revert()
>   (interactive)
>   (message "Reverting buffer from %s" buffer-file-name)
>   (revert-buffer nil 1)
>   (message "Done"))
> and bound it to a key.

I bind `f5' to

(defun revert-buffer-no-confirm ()
  (interactive) (revert-buffer t t))

so it acts like it does elsewhere in MS Windows.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  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 16:05           ` Michael Heerdegen
  2013-05-31 18:29             ` Óscar Fuentes
       [not found]           ` <mailman.767.1370016367.22516.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 31+ messages in thread
From: Michael Heerdegen @ 2013-05-31 16:05 UTC (permalink / raw)
  To: Dan Espen; +Cc: help-gnu-emacs

Dan Espen <despen@verizon.net> writes:

> Undoing a revert sounds very intuitive to me.

To me too.

> And the confirmation dialog on the revert was no fun,
> I had my own solution for bypassing the warning.
>
> I see no reason for any additional warnings.

To be clear: I don't want an additional prompt for confirmation, just a
short message in the minibuffer, like

[Undo: undoing `revert-buffer']

Because there are cases when the user (I) would want to stop at that
point.

> I assume this change kills off the old confirmation about reverting.
> (Posting from news:gnu.emacs.help).

I wonder why this prompt for confirmation was implemented.  I mean, you
seldom will type M-x revert-buffer RET by accident... If it's of no use
and everybody hates it, we should indeed consider to remove it, at least
for the interactive case.


Regards,

Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
@ 2013-05-31 16:49 Barry OReilly
  0 siblings, 0 replies; 31+ messages in thread
From: Barry OReilly @ 2013-05-31 16:49 UTC (permalink / raw)
  To: help-gnu-emacs

> To be clear: I don't want an additional prompt for confirmation,
> just a short message in the minibuffer, like
>
> [Undo: undoing `revert-buffer']
>
> Because there are cases when the user (I) would want to stop at that
> point.

I don't see why revert-buffer would be singled out, since many
different commands cause buffer changes.

If it were implemented, it may be better to generalize it to allow
any undo to have an annotation of what caused the change. Then the
user would set a defcustom for whether to echo an undo's annotation
while undoing. I could foresee Undo Tree's visualization displaying
the annotation next to its nodes.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
       [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
  0 siblings, 1 reply; 31+ messages in thread
From: Dan Espen @ 2013-05-31 17:22 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Dan Espen <despen@verizon.net> writes:
>
>> Undoing a revert sounds very intuitive to me.
>
> To me too.
>
>> And the confirmation dialog on the revert was no fun,
>> I had my own solution for bypassing the warning.
>>
>> I see no reason for any additional warnings.
>
> To be clear: I don't want an additional prompt for confirmation, just a
> short message in the minibuffer, like
>
> [Undo: undoing `revert-buffer']
>
> Because there are cases when the user (I) would want to stop at that
> point.
>
>> I assume this change kills off the old confirmation about reverting.
>> (Posting from news:gnu.emacs.help).
>
> I wonder why this prompt for confirmation was implemented.  I mean, you
> seldom will type M-x revert-buffer RET by accident... If it's of no use
> and everybody hates it, we should indeed consider to remove it, at least
> for the interactive case.

I always assumed it was because you were losing your undo history
making the action one that could not be reversed (undone).

-- 
Dan Espen


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-31 17:22             ` Dan Espen
@ 2013-05-31 18:08               ` Barry Margolin
  0 siblings, 0 replies; 31+ messages in thread
From: Barry Margolin @ 2013-05-31 18:08 UTC (permalink / raw)
  To: help-gnu-emacs

In article <icppw7m5dr.fsf@home.home>, Dan Espen <despen@verizon.net> 
wrote:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
> > I wonder why this prompt for confirmation was implemented.  I mean, you
> > seldom will type M-x revert-buffer RET by accident... If it's of no use
> > and everybody hates it, we should indeed consider to remove it, at least
> > for the interactive case.
> 
> I always assumed it was because you were losing your undo history
> making the action one that could not be reversed (undone).

That seems likely. Hence, with revert now undoable, there's not as much 
reason for the prompt.

Removing the prompt could potentially mess up saved keyboard macros. But 
it seems to me that revert-buffer is an extremely unlikely command to 
appear in a macro.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Reverting but keeping undo
  2013-05-31 16:05           ` Michael Heerdegen
@ 2013-05-31 18:29             ` Óscar Fuentes
  0 siblings, 0 replies; 31+ messages in thread
From: Óscar Fuentes @ 2013-05-31 18:29 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I wonder why this prompt for confirmation was implemented.  I mean, you
> seldom will type M-x revert-buffer RET by accident...

I do M-x UP ENTER all the time, sometimes being wrong about what was the
last command and not looking at the minibuffer.

C-x z is even worse.




^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2013-05-31 18:29 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).