From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#337: vc-diff forget previous point Date: Tue, 03 Jun 2008 03:24:32 -0400 Message-ID: References: Reply-To: Stefan Monnier , 337@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212479241 10750 80.91.229.12 (3 Jun 2008 07:47:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2008 07:47:21 +0000 (UTC) To: 337@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 09:48:03 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K3RFS-0004gd-N1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2008 09:48:02 +0200 Original-Received: from localhost ([127.0.0.1]:45970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3REg-0001eK-HT for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2008 03:47:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3REb-0001bc-0n for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:47:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3REa-0001af-Cd for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:47:08 -0400 Original-Received: from [199.232.76.173] (port=35808 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3REa-0001aI-3K for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:47:08 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:53977) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K3REZ-0004Jk-FH for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:47:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3REY-0002Dg-Lh for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:47:07 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m537l4VV000617; Tue, 3 Jun 2008 00:47:05 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m537U340028504; Tue, 3 Jun 2008 00:30:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 03 Jun 2008 07:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 337 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 337-submit@emacsbugs.donarmstrong.com id=B337.121247787527258 (code B ref 337); Tue, 03 Jun 2008 07:30:03 +0000 Original-Received: (at 337) by emacsbugs.donarmstrong.com; 3 Jun 2008 07:24:35 +0000 Original-Received: from ceviche.home (206-248-132-168.dsl.teksavvy.com [206.248.132.168]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m537OWda027252 for <337@emacsbugs.donarmstrong.com>; Tue, 3 Jun 2008 00:24:33 -0700 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3E671B423C; Tue, 3 Jun 2008 03:24:32 -0400 (EDT) In-Reply-To: (Ulrich Neumerkel's message of "Sat, 31 May 2008 01:05:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Tue, 03 Jun 2008 03:47:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18230 Archived-At: > With a file under version control, I do C-x v = (vc-diff) to walk > through and resolve differences. Since there are many, I re-issue > vc-diff to see the remaining differences. Unfortunately, vc-diff > forgets the previous point in buffer *vc-diff* resetting point to 0. > My expectation would be that the cursor remains where it has been (not > the literal point but the corresponding part to the same source line). > Maybe something similar to C-c C-c (diff-goto-source) but in the other > direction would be useful in general. Indeed. Dan had a patch to do just that, but it was never applied and it doesn't work any more, AFAICT. I never applied his patch because it wasn't doing quite the right thing. I think "The Right Thing" is to first look for the part of the diff that refers to the current file (in case the diff includes several files), and then within it, use a binary search with `diff-goto-source' to figure out the position in the diff buffer that jumps closest to point. This way, if point is within a part of the buffer where a hunk applies, the function should be able to find the exact character position corresponding to point, just like diff-goto-source does in the other direction. Patch welcome, Stefan