From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Becher Newsgroups: gmane.emacs.bugs Subject: bug#2612: VC annotate mode places point on wrong line number when narrowing is in effect Date: Mon, 09 Mar 2009 15:28:12 +0100 Message-ID: <49B5277C.9060905@capgemini-sdm.com> Reply-To: Alexander Becher , 2612@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236635918 19917 80.91.229.12 (9 Mar 2009 21:58:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Mar 2009 21:58:38 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 09 22:59:55 2009 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 1LgnVp-0007Ly-F8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Mar 2009 22:59:55 +0100 Original-Received: from localhost ([127.0.0.1]:36876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgnUT-0008A0-6N for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Mar 2009 17:58:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LghyQ-0005sR-J8 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 12:05:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LghyI-0005lF-RM for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 12:05:01 -0400 Original-Received: from [199.232.76.173] (port=37136 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LghyI-0005l6-LJ for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 12:04:54 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41784) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LghyF-0007wv-J0 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 12:04:54 -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 n29G3euv005291; Mon, 9 Mar 2009 09:03:41 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n29Ft3QH002850; Mon, 9 Mar 2009 08:55:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Alexander Becher Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 09 Mar 2009 15:55:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2612 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12366137191393 (code B ref -1); Mon, 09 Mar 2009 15:55:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 9 Mar 2009 15:48:39 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (terminus-est.gnu.org [66.92.78.210]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n29FmXDV001382 for ; Mon, 9 Mar 2009 08:48:35 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LghiN-0002n4-P8 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 11:48:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LghiM-0002lw-LG for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 11:48:27 -0400 Original-Received: from [199.232.76.173] (port=35419 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LghiM-0002lg-88 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 11:48:26 -0400 Original-Received: from world2.sdm.de ([192.76.162.230]:42009) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LghiL-0005us-F3 for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 11:48:26 -0400 Original-Received: from mucns1 ([10.40.232.18] helo=mucns1.sdm.de) by world2.sdm.de with esmtp (MTA) id 1LghiB-0008M2-5D for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 16:48:15 +0100 Original-Received: from sdmmail1.sdm.de ([10.40.232.6]) by mucns1.sdm.de with esmtp (MTA) id 1LghiB-0004uT-6N for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 16:48:15 +0100 Original-Received: from [127.0.0.1] ([80.253.211.78]) by sdmmail1.sdm.de with Microsoft SMTPSVC(6.0.3790.3959); Mon, 9 Mar 2009 16:48:14 +0100 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) X-OriginalArrivalTime: 09 Mar 2009 15:48:14.0451 (UTC) FILETIME=[7510C430:01C9A0CE] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 09 Mar 2009 12:05:01 -0400 X-Mailman-Approved-At: Mon, 09 Mar 2009 16:36:29 -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:26188 Archived-At: Actual Behaviour: The VC annotate mode automatically places point on the same line as it is in the buffer of the corresponding file. Thus, one sees the same line in the annotated buffer as in the file buffer. However, when narrowing is in effect in the file buffer when vc-annotate is called, point is placed on the wrong line. How to Reproduce: * Visit a version-controlled file with at least 2 lines. * Narrow to a region that does not start on line 1 (say, on line 2). * Place point on say, line 1 of the narrowed portion (i.e., line 2 of the file). * Call vc-annotate (C-x v g) * Note how point is on line 1 of the file instead of the expected line 2. Patch: In vc.el, surround the call to (line-number-at-pos) by a (save-restriction (widen) ...): diff -u "c:/Programme/emacs/emacs-22.2/lisp/vc.el~" "c:/Programme/emacs/emacs-22.2/lisp/vc.el" --- c:/Programme/emacs/emacs-22.2/lisp/vc.el~ 2008-02-04 03:32:56.000000000 +0100 +++ c:/Programme/emacs/emacs-22.2/lisp/vc.el 2009-03-04 17:57:40.078000000 +0100 @@ -3194,7 +3194,7 @@ ;; If BUF is specified, we presume the caller maintains current line, ;; so we don't need to do it here. This implementation may give ;; strange results occasionally in the case of REV != WORKFILE-REV. - (current-line (unless buf (line-number-at-pos)))) + (current-line (unless buf (save-restriction (widen) (line-number-at-pos))))) (message "Annotating...") ;; If BUF is specified it tells in which buffer we should put the ;; annotations. This is used when switching annotations to another Diff finished. Mon Mar 09 15:24:19 2009 By the Way: vc.el contains '$Id$', looks like keyword expansion was not switched on. In GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600) of 2008-03-26 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)'