[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2612: VC annotate mode places point on wrong line number when narrow
bug#2612: VC annotate mode places point on wrong line number when narrowing is in effect
Mon, 09 Mar 2009 15:28:12 +0100
Thunderbird 126.96.36.199 (Windows/20081209)
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
* Call vc-annotate (C-x v g)
* Note how point is on line 1 of the file instead of the expected line 2.
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~ 2008-02-04
+++ c:/Programme/emacs/emacs-22.2/lisp/vc.el 2009-03-04
@@ -3194,7 +3194,7 @@
;; If BUF is specified, we presume the caller maintains
;; so we don't need to do it here. This implementation may give
;; strange results occasionally in the case of REV !=
- (current-line (unless buf (line-number-at-pos))))
+ (current-line (unless buf (save-restriction (widen)
;; 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)'
- bug#2612: VC annotate mode places point on wrong line number when narrowing is in effect,
Alexander Becher <=