GNU bug report logs - #8366
wish: include vc-annotate-goto-line

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Uwe Brauer <oub@HIDDEN>; dated Mon, 28 Mar 2011 16:11:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 24 Apr 2011 19:43:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 24 15:43:44 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QE5Db-0004MC-Ne
	for submit <at> debbugs.gnu.org; Sun, 24 Apr 2011 15:43:43 -0400
Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1QE5DZ-0004Lw-9k
	for 8366 <at> debbugs.gnu.org; Sun, 24 Apr 2011 15:43:42 -0400
Received: from furball (dhcp128036225098.central.yale.edu [128.36.225.98])
	(authenticated bits=0)
	by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id
	p3OJhZvh007390
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 24 Apr 2011 15:43:35 -0400
Received: by furball (Postfix, from userid 1000)
	id ED3AA16055B; Sun, 24 Apr 2011 15:43:34 -0400 (EDT)
From: Chong Yidong <cyd@HIDDEN>
To: Juanma Barranquero <lekktu@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
References: <8762r3nus5.fsf@HIDDEN>
	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
	<AANLkTimfF=sJ6aixw1PXPVK4oY1v-vrx6hDuU8+Y=y-5@HIDDEN>
Date: Sun, 24 Apr 2011 15:43:34 -0400
In-Reply-To: <AANLkTimfF=sJ6aixw1PXPVK4oY1v-vrx6hDuU8+Y=y-5@HIDDEN>
	(Juanma Barranquero's message of "Tue, 29 Mar 2011 02:43:49 +0200")
Message-ID: <8739l7wi3d.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
	8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.7 (--)

Juanma Barranquero <lekktu@HIDDEN> writes:

>> Juanma, feel free to install such a feature.
>
> Hmm, no. It's just half-cooked; I threw it together in a few minutes
> to help the OP.
>
>> Annotate buffer may display a different version that the one of the
>> checked out file.  E.g. because you have local uncommitted changes, or
>> because you asked for the annotations of an older revision.  So line
>> numbers may not fully match.  In general, there's no much we can do
>> about it, but we should probably try a bit harder than the above,
>> e.g. by looking for the closest line with the same text as the line
>> we're looking for.  Better would be to ask for a diff between the
>> annotated revision and the current file and use it to find out the
>> line-offset to use (for those cases where this method works).
>
> Even if the buffer contains the same version, there's the matter of
> visual-line-mode, truncate-lines, etc. which can affect line count. So
> yes, for a robust answer looking at the context seems essential.

A non-robust implementation is better than nothing, so I committed the
command to the trunk, starting from your version, and revising it to use
vc-parent-buffer and emitting warning messages if the parent file/buffer
is modified or out of date.

As for the "look for the closest line with the same text" functionality,
my feeling is that this is a mug's game when version control is
involved.  If you or anyone else wants to take a stab at it, feel free.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 15:18:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 29 11:18:25 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4agb-0001SU-0T
	for submit <at> debbugs.gnu.org; Tue, 29 Mar 2011 11:18:25 -0400
Received: from mailout-de.gmx.net ([213.165.64.23])
	by debbugs.gnu.org with smtp (Exim 4.69)
	(envelope-from <rudalics@HIDDEN>) id 1Q4agX-0001SG-NU
	for 8366 <at> debbugs.gnu.org; Tue, 29 Mar 2011 11:18:23 -0400
Received: (qmail invoked by alias); 29 Mar 2011 15:18:15 -0000
Received: from 62-47-45-250.adsl.highway.telekom.at (EHLO [62.47.45.250])
	[62.47.45.250]
	by mail.gmx.net (mp065) with SMTP; 29 Mar 2011 17:18:15 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX19cZBMlwgpcZPBBau2Ms0SqcQJESSBiMZq5jxPg71
	l7KJZtTPnuGA/W
Message-ID: <4D91F835.4040403@HIDDEN>
Date: Tue, 29 Mar 2011 17:18:13 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
References: <8762r3nus5.fsf@HIDDEN>	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
	<4D919CA7.5060108@HIDDEN> <jwvvcz2avei.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvvcz2avei.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.5 (--)

 >> I'm often in need for a general, customizable function for finding the
 >> best match of some text in two different buffers.  For example, to get
 >> from a texinfo to an info buffer and vice-versa.  Any advances in that
 >> direction would be very appreciated.
 >
 > Damn!  And I thought you had this stashed in your window-pub branch!

I've stashed it somewhere else.  But it's far from perfect :-(

martin




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 13:52:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 29 09:52:14 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4ZL4-0007q4-BM
	for submit <at> debbugs.gnu.org; Tue, 29 Mar 2011 09:52:14 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1Q4ZL2-0007pc-1T
	for 8366 <at> debbugs.gnu.org; Tue, 29 Mar 2011 09:52:04 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEAIzikU1MCqRC/2dsb2JhbAClTHiIebwnhWoElhA
X-IronPort-AV: E=Sophos;i="4.63,262,1299474000"; d="scan'208";a="98499314"
Received: from 76-10-164-66.dsl.teksavvy.com (HELO pastel.home)
	([76.10.164.66])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	29 Mar 2011 09:51:58 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 23A2158EBD; Tue, 29 Mar 2011 09:51:58 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
Message-ID: <jwvvcz2avei.fsf-monnier+emacs@HIDDEN>
References: <8762r3nus5.fsf@HIDDEN>
	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN> <4D919CA7.5060108@HIDDEN>
Date: Tue, 29 Mar 2011 09:51:58 -0400
In-Reply-To: <4D919CA7.5060108@HIDDEN> (martin rudalics's message of "Tue, 29
	Mar 2011 10:47:35 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> I'm often in need for a general, customizable function for finding the
> best match of some text in two different buffers.  For example, to get
> from a texinfo to an info buffer and vice-versa.  Any advances in that
> direction would be very appreciated.

Damn!  And I thought you had this stashed in your window-pub branch!


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 09:16:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 29 05:16:27 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4V2J-00010c-9u
	for submit <at> debbugs.gnu.org; Tue, 29 Mar 2011 05:16:27 -0400
Received: from mailout-de.gmx.net ([213.165.64.23])
	by debbugs.gnu.org with smtp (Exim 4.69)
	(envelope-from <rudalics@HIDDEN>) id 1Q4V2G-00010P-Rl
	for 8366 <at> debbugs.gnu.org; Tue, 29 Mar 2011 05:16:25 -0400
Received: (qmail invoked by alias); 29 Mar 2011 09:16:18 -0000
Received: from 62-47-60-40.adsl.highway.telekom.at (EHLO [62.47.60.40])
	[62.47.60.40]
	by mail.gmx.net (mp009) with SMTP; 29 Mar 2011 11:16:18 +0200
X-Authenticated: #14592706
X-Provags-ID: V01U2FsdGVkX1/SlWNpKaTSOUQk1iv+/uvts1pfI7r26gWf4g1SA8
	qtDTeaZJLNvFk5
Message-ID: <4D919CA7.5060108@HIDDEN>
Date: Tue, 29 Mar 2011 10:47:35 +0200
From: martin rudalics <rudalics@HIDDEN>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
References: <8762r3nus5.fsf@HIDDEN>
	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.5 (--)

 > Annotate buffer may display a different version that the one of the
 > checked out file.  E.g. because you have local uncommitted changes, or
 > because you asked for the annotations of an older revision.  So line
 > numbers may not fully match.  In general, there's no much we can do
 > about it, but we should probably try a bit harder than the above,
 > e.g. by looking for the closest line with the same text as the line
 > we're looking for.  Better would be to ask for a diff between the
 > annotated revision and the current file and use it to find out the
 > line-offset to use (for those cases where this method works).

I'm often in need for a general, customizable function for finding the
best match of some text in two different buffers.  For example, to get
from a texinfo to an info buffer and vice-versa.  Any advances in that
direction would be very appreciated.

martin





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 03:32:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 28 23:32:49 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4Pfk-0001tV-Ev
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 23:32:48 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1Q4Pfi-0001t9-OU
	for 8366 <at> debbugs.gnu.org; Mon, 28 Mar 2011 23:32:46 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEAFNSkU1MCqRC/2dsb2JhbAClSHiIdrwWhWoElgY
X-IronPort-AV: E=Sophos;i="4.63,259,1299474000"; d="scan'208";a="98452099"
Received: from 76-10-164-66.dsl.teksavvy.com (HELO ceviche.home)
	([76.10.164.66])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	28 Mar 2011 23:32:41 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 02C3B660C7; Mon, 28 Mar 2011 23:32:41 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juanma Barranquero <lekktu@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
Message-ID: <jwvk4fi7gb5.fsf-monnier+emacs@HIDDEN>
References: <8762r3nus5.fsf@HIDDEN>
	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
	<AANLkTimfF=sJ6aixw1PXPVK4oY1v-vrx6hDuU8+Y=y-5@HIDDEN>
Date: Mon, 28 Mar 2011 23:32:40 -0400
In-Reply-To: <AANLkTimfF=sJ6aixw1PXPVK4oY1v-vrx6hDuU8+Y=y-5@HIDDEN>
	(Juanma Barranquero's message of "Tue, 29 Mar 2011 02:43:49 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> Even if the buffer contains the same version, there's the matter of
> visual-line-mode, truncate-lines, etc. which can affect line count.

count-lines and goto-line only pays attention to hard newlines and are
unaffected by display settings, so that shouldn't be an issue.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 00:44:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 28 20:44:37 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4N2y-0005A6-QB
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 20:44:37 -0400
Received: from mail-gx0-f172.google.com ([209.85.161.172])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <lekktu@HIDDEN>) id 1Q4N2w-00059t-KY
	for 8366 <at> debbugs.gnu.org; Mon, 28 Mar 2011 20:44:35 -0400
Received: by gxk19 with SMTP id 19so1358558gxk.3
	for <8366 <at> debbugs.gnu.org>; Mon, 28 Mar 2011 17:44:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc:content-type:content-transfer-encoding;
	bh=OqC3NvJpqZwa+7ABr/1YOjcURm+//hGocyaYajUrlNQ=;
	b=oY7qPuy39sQg7lZrlXvPmGZziH77ATVW9k6x2msKYjXP13J7htFJwRgopFu60mW4sy
	OR6W9VX272XTbxAUGW9yuJM5OA7z/+IIjQyah5wHjjrBhmDRzl4Ik0cErkeKTK8gPnP+
	acNTFy6O7QMr7VlKtbAdo3a+OYGXIF/eK6iNo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	b=GMO/pQD1Hk0SbWz4e7BbP2uqXYSmuyExH/QbQjHHusTFmaJsr3ID185+DAzZlMcT7u
	L8A+Ev1Jm+Qqgx2rlcBgAluUlrgXHmit1Svm3oIPfTki5lBqaX99OSCOZFm0zvXRtvmI
	cXzE4JxjU/kM0VXTy//D3xACb9GFVGH/9D1Dc=
Received: by 10.236.95.135 with SMTP id p7mr6502771yhf.184.1301359469120; Mon,
	28 Mar 2011 17:44:29 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.147.182.17 with HTTP; Mon, 28 Mar 2011 17:43:49 -0700 (PDT)
In-Reply-To: <jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
References: <8762r3nus5.fsf@HIDDEN>
	<jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
From: Juanma Barranquero <lekktu@HIDDEN>
Date: Tue, 29 Mar 2011 02:43:49 +0200
Message-ID: <AANLkTimfF=sJ6aixw1PXPVK4oY1v-vrx6hDuU8+Y=y-5@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: 8366
Cc: Uwe Brauer <oub@HIDDEN>, 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.3 (---)

On Mon, Mar 28, 2011 at 19:49, Stefan Monnier <monnier@HIDDEN> wr=
ote:

> Juanma, feel free to install such a feature.

Hmm, no. It's just half-cooked; I threw it together in a few minutes
to help the OP.

> AFAIK there should be a better way to find the file.
> E.g. vc-parent-buffer.

Fist time I've heard of it ;-)

> Annotate buffer may display a different version that the one of the
> checked out file. =C2=A0E.g. because you have local uncommitted changes, =
or
> because you asked for the annotations of an older revision. =C2=A0So line
> numbers may not fully match. =C2=A0In general, there's no much we can do
> about it, but we should probably try a bit harder than the above,
> e.g. by looking for the closest line with the same text as the line
> we're looking for. =C2=A0Better would be to ask for a diff between the
> annotated revision and the current file and use it to find out the
> line-offset to use (for those cases where this method works).

Even if the buffer contains the same version, there's the matter of
visual-line-mode, truncate-lines, etc. which can affect line count. So
yes, for a robust answer looking at the context seems essential.

=C2=A0 =C2=A0 Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at 8366 <at> debbugs.gnu.org:


Received: (at 8366) by debbugs.gnu.org; 29 Mar 2011 00:31:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 28 20:31:25 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4MqC-0004qC-OK
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 20:31:24 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1Q4MqB-0004pc-0j
	for 8366 <at> debbugs.gnu.org; Mon, 28 Mar 2011 20:31:23 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p2T0WSZS028583; 
	Mon, 28 Mar 2011 20:32:29 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 6D5FA6653A; Mon, 28 Mar 2011 13:49:48 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Uwe Brauer <oub@HIDDEN>
Subject: Re: bug#8366: wish: include vc-annotate-goto-line
Message-ID: <jwvzkofkum6.fsf-monnier+emacs@HIDDEN>
References: <8762r3nus5.fsf@HIDDEN>
Date: Mon, 28 Mar 2011 13:49:48 -0400
In-Reply-To: <8762r3nus5.fsf@HIDDEN> (Uwe Brauer's message of
	"Mon, 28 Mar 2011 17:12:42 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3810=0
X-NAI-Spam-Version: 2.2.0.9286 : core <3810> : streams <614374> : uri <837526>
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 8366
Cc: 8366 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.5 (-)

> I strongly suggesto to include this function.

Juanma, feel free to install such a feature.

> (defun vc-annotate-goto-line ()
>   (interactive)
>   (unless (eq major-mode 'vc-annotate-mode)
>     (error "vc-annotate-goto-line must be used on a VC-Annotate buffer"))
>   (let* ((name (buffer-name))
>          (base (and (string-match "Annotate \\(.*\\) (rev" name)

AFAIK there should be a better way to find the file.
E.g. vc-parent-buffer.

>                     (match-string 1 name)))
>          (line (save-restriction
>                  (widen)
>                  (line-number-at-pos))))
>     (with-current-buffer (get-buffer base)
>       (pop-to-buffer (current-buffer))
>       (save-restriction
>         (widen)
>         (goto-char (point-min))
>         (forward-line (1- line))
>         (recenter)))))

Annotate buffer may display a different version that the one of the
checked out file.  E.g. because you have local uncommitted changes, or
because you asked for the annotations of an older revision.  So line
numbers may not fully match.  In general, there's no much we can do
about it, but we should probably try a bit harder than the above,
e.g. by looking for the closest line with the same text as the line
we're looking for.  Better would be to ask for a diff between the
annotated revision and the current file and use it to find out the
line-offset to use (for those cases where this method works).


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Mar 2011 16:10:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 28 12:10:07 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q4F14-0000gl-EC
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 12:10:07 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <oub.oub.oub@HIDDEN>) id 1Q4E7e-0007ry-Dw
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 11:12:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <oub.oub.oub@HIDDEN>) id 1Q4E7Y-00069R-0o
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 11:12:45 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,
	T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:52403)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oub.oub.oub@HIDDEN>) id 1Q4E7X-00069E-Km
	for submit <at> debbugs.gnu.org; Mon, 28 Mar 2011 11:12:43 -0400
Received: from [140.186.70.92] (port=33289 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q4E7V-0007lv-0P
	for bug-gnu-emacs@HIDDEN; Mon, 28 Mar 2011 11:12:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <oub.oub.oub@HIDDEN>) id 1Q4E7P-00068I-Md
	for bug-gnu-emacs@HIDDEN; Mon, 28 Mar 2011 11:12:37 -0400
Received: from mail-wy0-f169.google.com ([74.125.82.169]:41597)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oub.oub.oub@HIDDEN>) id 1Q4E7P-00068C-DP
	for bug-gnu-emacs@HIDDEN; Mon, 28 Mar 2011 11:12:35 -0400
Received: by wyf19 with SMTP id 19so3459728wyf.0
	for <bug-gnu-emacs@HIDDEN>; Mon, 28 Mar 2011 08:12:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:sender:x-mailer:x-hashcash:to:subject:reply-to
	:from:date:message-id:user-agent:mime-version:content-type;
	bh=9ZMvVFd8oVPpjU4JNb8yFBtBvA7UeLIP1uRK1JHQ+z0=;
	b=JrfQ8w9PurulrJblDdEMZ+y/HtpNVpW+EopYfenkI19+9qg+cuaH7dNL683ye5xmzF
	rE9HC5Bo3xLjeaD905D9dA4wWh6zo9M8yLbc82/Y7Cmq5Y5Z2E/hiqhwHc4ac5kxaPUU
	+knxLXhdqioE5vFmT1xZpUiRqHMgZbDvjO3dE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:x-mailer:x-hashcash:to:subject:reply-to:from:date:message-id
	:user-agent:mime-version:content-type;
	b=Csi23hhN9GRnR6/dgfvBrOggv0Vq868L7nv8rK0gRQxikB2qMIefu7GZOaCA38u+qo
	KBu7depmMdCGU/fbSuydzlSECzM5IO8Vuq7jDcsYhBQDpV0r2czgrg+HldwZRS2JkKSF
	OATiM3FjBzOydCR0qXmVOcHGrQjOQPNkyR+Pg=
Received: by 10.216.62.77 with SMTP id x55mr3890903wec.59.1301325154230;
	Mon, 28 Mar 2011 08:12:34 -0700 (PDT)
Received: from gilgamesch.quim.ucm.es (maportatil12.quim.ucm.es [147.96.6.137])
	by mx.google.com with ESMTPS id t72sm1530691wei.44.2011.03.28.08.12.32
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 28 Mar 2011 08:12:33 -0700 (PDT)
X-Mailer: 21.4 (patch 21) "Educational Television" XEmacs Lucid (via feedmail
	11-beta-1 I)
X-Hashcash: 1:20:110328:bug-gnu-emacs@HIDDEN::moHFSWMV20nkU1zs:00000000000000000000000000000000000000001F6i
To: bug-gnu-emacs@HIDDEN
Subject: wish: include vc-annotate-goto-line
From: Uwe Brauer <oub@HIDDEN>
Date: Mon, 28 Mar 2011 17:12:42 +0200
Message-ID: <8762r3nus5.fsf@HIDDEN>
User-Agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.4.21 (linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 199.232.76.165
X-Spam-Score: -5.7 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 28 Mar 2011 12:10:04 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: Uwe Brauer <oub@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.8 (-----)

Hello

some days ago Juanma Barranquero wrote a very useful function which allows 
you to jump from the vc-annotate buffer to the corresponding point in the
file which is under vc. 


I strongly suggesto to include this function.

(defun vc-annotate-goto-line ()
  (interactive)
  (unless (eq major-mode 'vc-annotate-mode)
    (error "vc-annotate-goto-line must be used on a VC-Annotate buffer"))
  (let* ((name (buffer-name))
         (base (and (string-match "Annotate \\(.*\\) (rev" name)
                    (match-string 1 name)))
         (line (save-restriction
                 (widen)
                 (line-number-at-pos))))
    (with-current-buffer (get-buffer base)
      (pop-to-buffer (current-buffer))
      (save-restriction
        (widen)
        (goto-char (point-min))
        (forward-line (1- line))
        (recenter)))))

Uwe Brauer 

In GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2010-03-26 on palmer, modified by Ubuntu
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Apropos

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
y e s C-g C-x C-q C-x v v y y e s <return> y e s <return> 
C-x 2 C-x C-f C-g C-x o C-x o C-x 1 C-x C-f <backspace> 
<return> g <down> <down> <up> <up> <up> <up> <up> <down> 
f <end> <C-f1> <up> <up> <up> <up> <return> <return> 
<return> <return> <return> <up> <up> <up> C-x 2 C-x 
C-f <M-backspace> x e <tab> / s i <tab> v <tab> <M-backspace> 
<M-backspace> <M-backspace> <return> s <C-home> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <up> <up> <up> <up> <up> <up> <up> <up> f s 
<C-home> <down> <down> <down> f <C-end> <up> <up> <up> 
<up> <up> <up> <up> <up> C-SPC <down> <down> <down> 
<down> C-w C-y C-x o C-y <up> C-x C-e C-x o C-e C-x 
C-e <C-prior> <return> C-x C-f <backspace> <return> 
g C-x 1 f C-x C-s C-x k <return> g <down> <down> <down> 
f C-x v v C-c C-a C-c C-a C-c C-c <C-f12> <return> 
M-x e m a c s SPC s u <tab> C-h a b u g <return> C-x 
o C-s s u b m i t C-s C-s C-s C-s C-s C-s C-s <home> 
<next> <next> <next> <next> <prior> <home> C-s e m 
a c s - b C-s C-x o M-x r e p o r t SPC e m <tab> <return> 
w i s h : SPC i n c l u c <backspace> d e SPC <f10> 
<S-f1> <help-echo> <down-mouse-1> <mouse-1> C-g C-x 
C-x o C-x o C-x o C-g <backspace> C-x C-f s i <tab> 
v c <tab> <backspace> <backspace> v <tab> v c <tab> 
a <tab> <return> <next> <next> <next> <next> <next> 
<next> <next> <next> <down> <right> <right> <right> 
<right> <right> <right> <right> C-M-k C-y C-x o x M-x 
r e p o r <tab> <return>

Recent messages:
Loading apropos...done
Type C-x 1 to remove help window.  
Mark saved where search started
Mark set [2 times]
Mark saved where search started
Loading emacsbug...done
Quit
exchange-point-and-mark: No mark set in this buffer
Quit
Mark set
byte-code: Buffer is read-only: #<buffer *Apropos*>





Acknowledgement sent to Uwe Brauer <oub@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#8366; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.