From 1867d8cbc577bccc5dcc900a114f47daa48192a7 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 13 Apr 2006 13:36:54 +0000 Subject: [PATCH] (vc-annotate): Arrange for point to end up at the same line number as in the original, but only when using a new buffer. --- lisp/ChangeLog | 7 ++++++- lisp/vc.el | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9048ac64fe3..b607a1eec27 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-04-13 Thien-Thi Nguyen + + * vc.el (vc-annotate): Arrange for point to end up at the same + line number as in the original, but only when using a new buffer. + 2006-04-12 Davis Herring (tiny change) * files.el (hack-one-local-variable-eval-safep): Recognize @@ -21,7 +26,7 @@ 2006-04-13 Nick Roberts - * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers): + * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers): GDB 6.1+ gives full filename for "info sources" so use file-name-nondirectory. 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) -- 2.39.2