From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: avoiding revert-buffer after vc-checkin Date: Wed, 18 Jul 2007 22:57:44 -0400 Message-ID: References: <200707180547.l6I5luxe002955@oogie-boogie.ics.uci.edu> <85ir8hxv9n.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1184813897 8294 80.91.229.12 (19 Jul 2007 02:58:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2007 02:58:17 +0000 (UTC) Cc: Dan Nicolaescu , emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 19 04:58:16 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 1IBMDX-0002Dh-JA for ged-emacs-devel@m.gmane.org; Thu, 19 Jul 2007 04:58:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBMDX-00020d-7t for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2007 22:58:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IBMDT-00020X-9X for emacs-devel@gnu.org; Wed, 18 Jul 2007 22:58:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IBMDR-00020L-TA for emacs-devel@gnu.org; Wed, 18 Jul 2007 22:58:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IBMDR-00020I-NL for emacs-devel@gnu.org; Wed, 18 Jul 2007 22:58:09 -0400 Original-Received: from tomts5.bellnexxia.net ([209.226.175.25] helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IBMDQ-0000BM-Cx; Wed, 18 Jul 2007 22:58:08 -0400 Original-Received: from pastel.home ([70.55.145.83]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070719025744.ZPPE1592.tomts5-srv.bellnexxia.net@pastel.home>; Wed, 18 Jul 2007 22:57:44 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 262B47FFA; Wed, 18 Jul 2007 22:57:43 -0400 (EDT) In-Reply-To: <85ir8hxv9n.fsf@lola.goethe.zz> (David Kastrup's message of "Wed\, 18 Jul 2007 23\:21\:56 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:75105 Archived-At: >> Indeed. My own take on this problem is to change revert-buffer so that it >> doesn't throw away the undo info. > Revert-buffer throws away the undo info because usually after > revert-buffer the undo-info is useless. In my use pattern, the undo info is rarely useless after revert buffer. Of course, the revert-buffer operation itself adds undo entries corresponding to the changes it made. >> 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. > And how will you cater for CVS having replaced $Id: ...$ strings and > similar? How do you know which offsets to apply to the undo info in > order to compensate for that? I don't need to: the usual C code takes care of that. All I did was change insert-file-contents so that it doesn't explicitly throw away the undo info that is otherwise correctly computed by the underlying primitives. Stefan