From unknown Mon Jun 23 02:20:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2612 <2612@debbugs.gnu.org> To: bug#2612 <2612@debbugs.gnu.org> Subject: Status: VC annotate mode places point on wrong line number when narrowing is in effect Reply-To: bug#2612 <2612@debbugs.gnu.org> Date: Mon, 23 Jun 2025 09:20:05 +0000 retitle 2612 VC annotate mode places point on wrong line number when narrow= ing is in effect reassign 2612 emacs submitter 2612 Alexander Becher severity 2612 normal thanks From alexander.becher@capgemini-sdm.com Mon Mar 9 08:48:39 2009 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)' From cyd@stupidchicken.com Mon Mar 9 17:59:51 2009 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@debbugs.gnu.org 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. From lekktu@gmail.com Tue Mar 17 02:22:15 2009 Received: (at control) by emacsbugs.donarmstrong.com; 17 Mar 2009 09:22:15 +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=2.3 required=4.0 tests=MISSING_SUBJECT,NOSUBJECT, VALID_BTS_CONTROL autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-ew0-f176.google.com (mail-ew0-f176.google.com [209.85.219.176]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2H9MCD0005523 for ; Tue, 17 Mar 2009 02:22:14 -0700 Received: by ewy24 with SMTP id 24so3991757ewy.1 for ; Tue, 17 Mar 2009 02:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=8kg3xZo7LkfeWm8/N+Bb5gCTHDvSowOAk/GT0NUKjNc=; b=sS/XKophFfzDqrpZxSKYexjpSHOEBgWFBIntADHTWgLQ7xAkX2LJay0VW5/a9alnYU JqK5mkqwrC9L2Iu+b+OHuLWMs4dh1ivw0p3TpVFe4KfkhmlI8VYyhAH9+vGdgV/V/aj8 ZjrZbQHD9z3NgdBNX9dcvrhXE1JDzicWFM4Uo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=epHiHh4jTH8hNQ3Z9W+sdmPMWG5K8t56w3EIXDv+nyc7uMUO0OebD87ssmj47nN/8V gEn2T5weZyGT7QqOtX3mDXQokeXZQjhWmeLaUkSzN5IXPiPJhZ8VSTSKiUUROU4m5YrP Wm9HxlDTvoTR98dZx15fhqd+5ewRn1t26NJDo= MIME-Version: 1.0 Received: by 10.210.139.15 with SMTP id m15mr4357553ebd.9.1237281726835; Tue, 17 Mar 2009 02:22:06 -0700 (PDT) Date: Tue, 17 Mar 2009 10:22:06 +0100 Message-ID: Subject: From: Juanma Barranquero To: control@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit reassign 337 emacs,vc reassign 768 emacs,vc reassign 927 emacs,vc reassign 996 emacs,vc reassign 1098 emacs,vc reassign 1163 emacs,vc reassign 1256 emacs,vc reassign 1257 emacs,vc reassign 1408 emacs,vc reassign 1429 emacs,vc reassign 1589 emacs,vc reassign 1647 emacs,w32,vc reassign 1741 emacs,vc reassign 2093 emacs,vc reassign 2110 emacs,vc reassign 2117 emacs,vc reassign 2157 emacs,vc reassign 2338 emacs,vc reassign 2553 emacs,vc reassign 2598 emacs,vc reassign 2604 emacs,vc reassign 2612 emacs,vc reassign 2641 emacs,vc reassign 2652 emacs,vc reassign 2675 emacs,vc reassign 2676 emacs,vc reassign 2678 emacs,vc quit From unknown Mon Jun 23 02:20:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Apr 2009 14:24:05 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator