unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: andreas.roehler@easy-emacs.de, 8447@debbugs.gnu.org
Subject: bug#8447: Undoing M-x revert-buffer
Date: Wed, 29 May 2013 06:27:40 -0700 (PDT)	[thread overview]
Message-ID: <a681596f-44e9-4ed5-a078-e4a0c62a0aed@default> (raw)
In-Reply-To: <51A59D77.9040709@easy-emacs.de>

> >> I just installed into the trunk a patch which should make
> >> revert-buffer undoable.
> >
> > FWIW, see my comment on this in the help list:
> > http://lists.gnu.org/archive/html/help-gnu-emacs/2013-05/msg00671.html
> >
> > In sum, why?  And why no discussion?  Where was the "bug"?

> as it happened, run sometimes into this:
> reverting the buffer, which turned out not the right thing - but undo-
> history was lost. Consider it a useful change, thanks.

By "turned out not the right thing" I guess you mean that someone used `revert-buffer' interactively and by mistake.  And by mistake also _confirmed_ reverting.  Yes, it can happen (to anyone).

So define a command `revert-buffer-keeping-undo', and use that interactively instead of `revert-buffer'.  Or define a variable (option or internal) `revert-buffer-keeps-undo'.

What you cite is a user-interface issue - i.e., only for interactive use of the command.  Such a change, to safeguard against mistaken reverting, is akin to removing files to a trash bin instead of deleting them.  But we did not just willy nilly change the behavior of the basic function (command) `delete-file' when we added support for a recycle/trash bin.  That's not the right approach.

With extra interactive protection as the only reason, this is also akin to some users (me, for instance) wanting `C-w' to prompt for confirmation if the region is over a certain size (as in wimpy-del.el).  Certainly such safeguard features can be useful.

But this change goes way beyond offering users optional extra protection.  `revert-buffer' is also used in basic code.

The right way to add such protection against mistaken reversion is to create a separate command or option, letting users choose to use it or not.  And leave the basic `revert-buffer' alone.

FWIW, I agree that such a feature can be useful for reverting interactively.

And why no discussion before making such a change?





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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 15:54 bug#8447: Undoing M-x revert-buffer Hrvoje Nikšić
2011-04-09  1:49 ` Stefan Monnier
2011-04-12  4:25 ` Kevin Rodgers
2013-05-29  1:08 ` Stefan Monnier
2013-05-29  3:15   ` Drew Adams
2013-05-29  6:17     ` Andreas Röhler
2013-05-29 13:27       ` Drew Adams [this message]
2013-05-30 16:57         ` Andreas Röhler

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=a681596f-44e9-4ed5-a078-e4a0c62a0aed@default \
    --to=drew.adams@oracle.com \
    --cc=8447@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    /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 public inbox

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

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