GNU bug report logs - #2612
VC annotate mode places point on wrong line number when narrowing is in effect

Previous Next

Package: emacs;

Reported by: Alexander Becher <alexander.becher <at> capgemini-sdm.com>

Date: Mon, 9 Mar 2009 15:55:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2612 in the body.
You can then email your comments to 2612 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2612; Package emacs. (Mon, 09 Mar 2009 15:55:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Becher <alexander.becher <at> capgemini-sdm.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 09 Mar 2009 15:55:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alexander Becher <alexander.becher <at> capgemini-sdm.com>
To: bug-gnu-emacs <at> gnu.org
Subject: VC annotate mode places point on wrong line number when narrowing
 is in effect
Date: Mon, 09 Mar 2009 15:28:12 +0100
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)'








Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Tue, 10 Mar 2009 01:05:07 GMT) Full text and rfc822 format available.

Notification sent to Alexander Becher <alexander.becher <at> capgemini-sdm.com>:
bug acknowledged by developer. (Tue, 10 Mar 2009 01:05:07 GMT) Full text and rfc822 format available.

Message #10 received at 2612-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alexander Becher <alexander.becher <at> capgemini-sdm.com>
Cc: 2612-done <at> 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
> 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.




bug reassigned from package `emacs' to `emacs,vc'. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 17 Mar 2009 09:30:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Tue, 14 Apr 2009 14:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 73 days ago.

Previous Next


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