From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: avoiding revert-buffer after vc-checkin Date: Thu, 19 Jul 2007 17:21:15 -0400 Message-ID: References: <200707180547.l6I5luxe002955@oogie-boogie.ics.uci.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1184880077 1945 80.91.229.12 (19 Jul 2007 21:21:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2007 21:21:17 +0000 (UTC) Cc: dann@ics.uci.edu, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 19 23:21:15 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IBdQw-0006yT-Eg for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2007 23:21:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBdQv-0000HE-TG for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2007 17:21:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IBdPo-0007qO-Ul for emacs-devel@gnu.org; Thu, 19 Jul 2007 17:20:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IBdPo-0007q4-BO for emacs-devel@gnu.org; Thu, 19 Jul 2007 17:20:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBdPo-0007pz-6x for emacs-devel@gnu.org; Thu, 19 Jul 2007 17:20:04 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IBdPn-00039w-W1 for emacs-devel@gnu.org; Thu, 19 Jul 2007 17:20:04 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IBdQx-00030i-4y; Thu, 19 Jul 2007 17:21:15 -0400 In-reply-to: (message from Stefan Monnier on Wed, 18 Jul 2007 14:53:32 -0400) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:75138 Archived-At: I understand that some people find this idea completely unacceptable, so maybe a good compromise is to just provide a way to tell revert-buffer not to throw away the undo info, and then use it in vc.el. There is nothing magic about the undo data structure. It is easy to preserve it, by binding buffer-undo-list. But if you want this to work right, you should also make undo records for any text changes made by reverting. It would not be terribly hard to compare the file with the buffer contents, find what the differences will be, then revert, then construct new undo entries for those differences. It could write the buffer to a temp file, then use diff to localize the changes. If the changes in the diff output make sense, it can construct undo entries. Want to implement it?