summaryrefslogtreecommitdiff
path: root/lisp/vc.el
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2006-04-13 13:36:54 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2006-04-13 13:36:54 +0000
commit1867d8cbc577bccc5dcc900a114f47daa48192a7 (patch)
treef3c6dfd8f44930950676f707c59d78859a212dc8 /lisp/vc.el
parent1007cd5f2beb810ee16e830e6bf84d9907ab76d3 (diff)
downloademacs-1867d8cbc577bccc5dcc900a114f47daa48192a7.tar.gz
(vc-annotate): Arrange for point to end up at the same
line number as in the original, but only when using a new buffer.
Diffstat (limited to 'lisp/vc.el')
-rw-r--r--lisp/vc.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 9a782b4f11d..61b8aa05a4b 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -3107,7 +3107,11 @@ colors. `vc-annotate-background' specifies the background color."
(vc-ensure-vc-buffer)
(setq vc-annotate-display-mode display-mode) ;Not sure why. --Stef
(let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
- (temp-buffer-show-function 'vc-annotate-display-select))
+ (temp-buffer-show-function 'vc-annotate-display-select)
+ ;; 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))))
(message "Annotating...")
;; If BUF is specified it tells in which buffer we should put the
;; annotations. This is used when switching annotations to another
@@ -3129,6 +3133,8 @@ colors. `vc-annotate-background' specifies the background color."
(set (make-local-variable 'vc-annotate-parent-rev) rev)
(set (make-local-variable 'vc-annotate-parent-display-mode)
display-mode)))
+ (when current-line
+ (goto-line current-line temp-buffer-name))
(message "Annotating... done")))
(defun vc-annotate-prev-version (prefix)