From ebaac04d9128601085877463143b29a5934dec69 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 7 Aug 2007 03:32:24 +0000 Subject: [PATCH] (vc-annotate): Select temp-buffer before running vc-exec-after. Select the buffer's window before moving point. --- lisp/ChangeLog | 7 ++++++- lisp/vc.el | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a64a298d1a..f8bf2d8f1be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-07 Stefan Monnier + + * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after. + Select the buffer's window before moving point. + 2007-08-07 Richard Stallman * term.el (term): Remove parent group `unix'. @@ -50,7 +55,7 @@ * term.el: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. - (term-default-fg-color, term-default-bg-color): Initialized from + (term-default-fg-color, term-default-bg-color): Initialize from default term-current-face. (term-mode, term-reset-terminal): Set term-current-face with term-default-fg-color and term-default-bg-color. diff --git a/lisp/vc.el b/lisp/vc.el index 2b2dd9fb8c9..76253bdfd5b 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -3272,12 +3272,19 @@ colors. `vc-annotate-background' specifies the background color." (set (make-local-variable 'vc-annotate-parent-display-mode) display-mode))) - (vc-exec-after - `(progn - (when ,current-line - (goto-line ,current-line ,temp-buffer-name)) - (unless (active-minibuffer-window) - (message "Annotating... done")))))) + (with-current-buffer temp-buffer-name + (vc-exec-after + `(progn + ;; Ideally, we'd rather not move point if the user has already + ;; moved it elsewhere, but really point here is not the position + ;; of the user's cursor :-( + (when ,current-line ;(and (bobp)) + (let ((win (get-buffer-window (current-buffer) 0))) + (when win + (with-selected-window win + (goto-line ,current-line))))) + (unless (active-minibuffer-window) + (message "Annotating... done"))))))) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one. -- 2.39.5