From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: [rant] Should reverting a buffer really discard undo history? Date: Thu, 02 Jun 2005 11:10:47 -0700 Message-ID: <200506021810.j52IApKE007655@scanner2.ics.uci.edu> References: <87ll5w5vxa.fsf@wigwam.deepwood.net> <874qck8ky7.fsf-monnier+emacs@gnu.org> <200506012319.j51NJk3i012173@amrm2.ics.uci.edu> <87ll5tpsh9.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117735990 22964 80.91.229.2 (2 Jun 2005 18:13:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2005 18:13:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 02 20:13:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ddu9B-0007E8-PJ for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2005 20:10:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DduEj-0007Qs-8X for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2005 14:16:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DduCw-0006g4-0x for emacs-devel@gnu.org; Thu, 02 Jun 2005 14:14:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DduCk-0006ag-LY for emacs-devel@gnu.org; Thu, 02 Jun 2005 14:14:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DduCh-0006Rh-6X for emacs-devel@gnu.org; Thu, 02 Jun 2005 14:14:03 -0400 Original-Received: from [128.195.1.36] (helo=scanner2.ics.uci.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DduCQ-000445-57 for emacs-devel@gnu.org; Thu, 02 Jun 2005 14:13:46 -0400 Original-Received: from vino.ics.uci.edu (vino.ics.uci.edu [128.195.11.198]) by scanner2.ics.uci.edu (8.12.10/8.12.10) with ESMTP id j52IApKE007655; Thu, 2 Jun 2005 11:10:51 -0700 (PDT) Original-To: Stefan Monnier In-Reply-To: <87ll5tpsh9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 01 Jun 2005 19:31:56 -0400") Original-Lines: 20 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-98.8, required 5, J_CHICKENPOX_45, J_CHICKENPOX_66, USER_IN_WHITELIST) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38050 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38050 Stefan Monnier writes: > > Maybe other users have a different experience, but for me 99% of the > > time I would like undo info after a revert is when revert was invoked > > by VC/pcl-cvs after a commit. > > So from this users point of view if VC/pcl-cvs were not to revert the > > buffer, saving undo after revert would not be missed much. > > Indeed, it may also be useful to allow the revert-undoability to be > specified on a revert-by-revert basis. And VC/PCL-CVS would be well served > by a "revert carefully" which would do something like "diff+patch" rather > than an actual revert. Note that revert already does a limited form of > diff+patch since it checks the prefix&suffix of the file/buffer which hasn't > changed, so if only one line was changed the undo would record only > a one-line change rather than a complete delete+insert of the whole buffer. If saving undo after revert is not implemented/accepted would it be possible to avoid the revert if it is not needed after a commit? Wouldn't a (string= (md5 FILE) (md5 BUFFER)) be enough to avoid reverting?