From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: 4 minor suggestions for files.el Date: Mon, 05 May 2003 10:57:34 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305051457.h45EvYlA007032@rum.cs.yale.edu> References: <200304142022.h3EKMHRu026814@rum.cs.yale.edu> <200304172139.h3HLdBvK009948@rum.cs.yale.edu> <200304292107.h3TL7Kl9007427@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052148206 10582 80.91.224.249 (5 May 2003 15:23:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 5 May 2003 15:23:26 +0000 (UTC) Cc: Stefan Monnier Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 05 17:23:17 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ChRa-0001Bb-00 for ; Mon, 05 May 2003 16:59:54 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19ChUd-0001z0-00 for ; Mon, 05 May 2003 17:03:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19ChRg-0003Y7-03 for emacs-devel@quimby.gnus.org; Mon, 05 May 2003 11:00:00 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19ChRN-0003Vy-00 for emacs-devel@gnu.org; Mon, 05 May 2003 10:59:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19ChRI-0003Tj-00 for emacs-devel@gnu.org; Mon, 05 May 2003 10:59:40 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19ChPL-0002TV-00; Mon, 05 May 2003 10:57:35 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h45EvZx6007034; Mon, 5 May 2003 10:57:35 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h45EvYlA007032; Mon, 5 May 2003 10:57:34 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Original-cc: spiegel@gnu.org Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13696 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13696 > > I think that the correct way for check-in and update to interact with > > M-x undo is to transpose the old undo list somehow to the buffer as it > > has been updated. > > That's what undo-in-region does. > > undo-in-region does a special case of this. It does not handle the > generality that would be needed for this, and I think that would require > new methods. Sure, it's not quite the same, but I use it to get the desired result. > > Likewise, if I edit the buffer and then do a CVS update, I should > > then be able to undo the edit I made, but not the changes made by > > the CVS update. > > Why not ? > > When you do a CVS update, you don't know what changes are getting > merged in. You often don't see them; they are in parts of the file > where you have not been working. > > If a single undo operation would undo all of them, you would lose > them and not know what you are losing. That is risky and not the > right interface. > > In order for undo in Emacs to operate in a predictable and reliable > way, it should undo the changes that you made with your editing. If > you want to undo the changes that came from CVS, that should be a > separate command, designed to coordinate with CVS. What I have in > mind is a command to take out the changes that were made between a > certain pair of versions. CVS generally doesn't know: the local file generally has local modifications (otherwise, there's generally no interesting undo log to worry about) so the merge done by `cvs update' is not the same as the change recorded in the repository. Also, most of the time that I use such an undo, it's only to temporarily take a look at a previous state of the buffer: I virtually never want to save the file with the change undone. The only exception is when I want to undo (in the repository) a change I installed recently, but I rarely if ever use Emacs undo for it (I use `cvs diff' and reverse-apply the patch, instead). I.e. in my experience, undoing the revert (rather than only undoing changes done before the revert) never hurts and is sometimes useful. I see cases where your refinement (i.e. adjusting the "before revert" undo log so it applies to the "after revert" buffer) can be marginally better, but I doubt it's worth the effort, especially since it prevents the user from undoing the revert itself which can also be something she wants to do. Stefan