From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#2612: marked as done (VC annotate mode places point on wrong line number when narrowing is in effect) Date: Tue, 10 Mar 2009 01:05:07 +0000 Message-ID: References: <87r616dwdt.fsf@cyd.mit.edu> <49B5277C.9060905@capgemini-sdm.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1236647107-22132-0" X-Trace: ger.gmane.org 1236649036 23015 80.91.229.12 (10 Mar 2009 01:37:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2009 01:37:16 +0000 (UTC) To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 10 02:38:31 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from mail-forward2.uio.no ([129.240.10.71]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lgqrm-0008BY-2m for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 02:34:46 +0100 Original-Received: from exim by mail-out2.uio.no with local-bsmtp (Exim 4.69) (envelope-from ) id 1LgqqQ-00020T-RL for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 02:33:22 +0100 Original-Received: from mail-mx5.uio.no ([129.240.10.46]) by mail-out2.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1LgqqQ-00020K-Q0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 02:33:22 +0100 Original-Received: from lists.gnu.org ([199.232.76.165]) by mail-mx5.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LgqqP-0004LQ-Cu for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 02:33:22 +0100 Original-Received: from localhost ([127.0.0.1]:40572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgqin-0005Aa-9D for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Mar 2009 21:25:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgqhE-0004Bz-Tn for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 21:23:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgqhA-00047j-5s for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 21:23:48 -0400 Original-Received: from [199.232.76.173] (port=50605 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgqh8-000471-Qh for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 21:23:46 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:59819) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lgqh8-00080D-2r for bug-gnu-emacs@gnu.org; Mon, 09 Mar 2009 21:23:46 -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 n2A1Ne0u027099; Mon, 9 Mar 2009 18:23:41 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2A157rq022275; Mon, 9 Mar 2009 18:05:07 -0700 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 2612 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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 X-UiO-Spam-info: not spam, SpamAssassin (score=-4.0, required=5.0, autolearn=disabled, RCVD_IN_DNSWL_MED=-4, uiobl=NO, uiouri=NO) X-UiO-Scanned: 04B21F591C3B68BC3A8BE33296DE685F21E2234A X-UiO-SPAM-Test: remote_host: 199.232.76.165 spam_score: -39 maxlevel 200 minaction 2 bait 0 mail/h: 3 total 93695 max/h 424 blacklist 0 greylist 0 ratelimit 0 Xref: news.gmane.org gmane.emacs.bugs:26199 Archived-At: This is a multi-part message in MIME format... ------------=_1236647107-22132-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Mon, 09 Mar 2009 21:01:02 -0400 with message-id <87r616dwdt.fsf@cyd.mit.edu> and subject line Re: VC annotate mode places point on wrong line number whe= n narrowing is in effect has caused the Emacs bug report #2612, regarding VC annotate mode places point on wrong line number when narrowing= is in effect to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 2612: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D2612 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1236647107-22132-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 9 Mar 2009 15:48:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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 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 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 Message-ID: <49B5277C.9060905@capgemini-sdm.com> Date: Mon, 09 Mar 2009 15:28:12 +0100 From: Alexander Becher User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: VC annotate mode places point on wrong line number when narrowing is in effect Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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) 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)' ------------=_1236647107-22132-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2612-done) by emacsbugs.donarmstrong.com; 10 Mar 2009 00:59:52 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2A0xnMZ019837 for <2612-done@emacsbugs.donarmstrong.com>; Mon, 9 Mar 2009 17:59:50 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 7DF4557E21A; Mon, 9 Mar 2009 21:01:02 -0400 (EDT) From: Chong Yidong To: Alexander Becher Cc: 2612-done@emacsbugs.donarmstrong.com Subject: Re: VC annotate mode places point on wrong line number when narrowing is in effect Date: Mon, 09 Mar 2009 21:01:02 -0400 Message-ID: <87r616dwdt.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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. Thanks, I've checked your patch into CVS. ------------=_1236647107-22132-0--