# HG changeset patch # User Stefan Monnier # Date 1186457544 0 # Node ID 42ad26e14a9903279b6150569f527d0f8eb327df # Parent 108a0fa4a1148c2071f7798ca6f1f927b41eb7f5 (vc-annotate): Select temp-buffer before running vc-exec-after. Select the buffer's window before moving point. diff -r 108a0fa4a114 -r 42ad26e14a99 lisp/ChangeLog --- a/lisp/ChangeLog Tue Aug 07 03:10:23 2007 +0000 +++ b/lisp/ChangeLog Tue Aug 07 03:32:24 2007 +0000 @@ -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 -r 108a0fa4a114 -r 42ad26e14a99 lisp/vc.el --- a/lisp/vc.el Tue Aug 07 03:10:23 2007 +0000 +++ b/lisp/vc.el Tue Aug 07 03:32:24 2007 +0000 @@ -3272,12 +3272,19 @@ (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.