GNU bug report logs -
#8447
Undoing M-x revert-buffer
Previous Next
Reported by: Hrvoje Nikšić <hniksic <at> gmail.com>
Date: Fri, 8 Apr 2011 16:17:02 UTC
Severity: wishlist
Merged with 10776
Fixed in version 24.4
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #25 received at submit <at> debbugs.gnu.org (full text, mbox):
> >> 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?
This bug report was last modified 11 years and 364 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.