From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Espen Newsgroups: gmane.emacs.help Subject: Re: Reverting but keeping undo Date: Thu, 30 May 2013 21:21:55 -0400 Organization: A noiseless patient Spider Message-ID: References: <87mwrwede7.fsf@wanadoo.es> <878v2w8g3t.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369963922 28616 80.91.229.3 (31 May 2013 01:32:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 May 2013 01:32:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 31 03:32:03 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UiECH-0004pf-PY for geh-help-gnu-emacs@m.gmane.org; Fri, 31 May 2013 03:32:01 +0200 Original-Received: from localhost ([::1]:48609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiECH-0006pm-Bn for geh-help-gnu-emacs@m.gmane.org; Thu, 30 May 2013 21:32:01 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Injection-Info: mx05.eternal-september.org; posting-host="b8816fa7300cd668c1c8ea38fc847e8a"; logging-data="636"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18boWEi5vvUAtSh+9qndYhmlzUYm9Op3RQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:mmpxDsU3bZnB4rQ+z4DabEsu3z4= sha1:85MbGB7aY0E80W+B+PcukWBZPo4= Original-Xref: usenet.stanford.edu gnu.emacs.help:198924 X-Mailman-Approved-At: Thu, 30 May 2013 21:31:49 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91190 Archived-At: Stefan Monnier 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