]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-annotate): Arrange for point to end up at the same
authorThien-Thi Nguyen <ttn@gnuvola.org>
Thu, 13 Apr 2006 13:36:54 +0000 (13:36 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Thu, 13 Apr 2006 13:36:54 +0000 (13:36 +0000)
line number as in the original, but only when using a new buffer.

lisp/ChangeLog
lisp/vc.el

index 9048ac64fe3ac66536b3a17428a475d2f5335e03..b607a1eec27620240a30fdd03add514fd49ca3fa 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-13  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * 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  <herring@lanl.gov>  (tiny change)
 
        * files.el (hack-one-local-variable-eval-safep): Recognize
@@ -21,7 +26,7 @@
 
 2006-04-13  Nick Roberts  <nickrob@snap.net.nz>
 
-       * 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.
 
index 9a782b4f11d6305424ca910ec714abd9a1944c2e..61b8aa05a4ba16e759010bc6c7b51b9486f9bb0d 100644 (file)
@@ -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)