From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: patch: vc.el annotation prev/next "in place" Date: 05 Apr 2006 17:15:04 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144271726 32261 80.91.229.2 (5 Apr 2006 21:15:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Apr 2006 21:15:26 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 05 23:15:21 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FRFLU-0004bC-2y for ged-emacs-devel@m.gmane.org; Wed, 05 Apr 2006 23:15:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRFLT-0001UU-G3 for ged-emacs-devel@m.gmane.org; Wed, 05 Apr 2006 17:15:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FRFLI-0001UP-JY for emacs-devel@gnu.org; Wed, 05 Apr 2006 17:15:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FRFLG-0001U5-9J for emacs-devel@gnu.org; Wed, 05 Apr 2006 17:15:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FRFLG-0001U2-1T for emacs-devel@gnu.org; Wed, 05 Apr 2006 17:15:06 -0400 Original-Received: from [67.59.132.6] (helo=mail.agora-net.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FRFOq-0000CO-Q6 for emacs-devel@gnu.org; Wed, 05 Apr 2006 17:18:48 -0400 Original-Received: from ttn by mail.agora-net.com with local (Exim 4.50) id 1FRFLE-0005r6-KA for emacs-devel@gnu.org; Wed, 05 Apr 2006 17:15:04 -0400 Original-To: emacs-devel@gnu.org Original-Lines: 78 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52456 Archived-At: i month or so ago, i complained about the P and N (and J) commands in vc-annotate buffer ending up (selecting) another buffer/window. the following patch reverts the old behavior, according to my tastes, but i suspect there is a better way, by avoiding `switch-to-buffer', for example. what do you think? thi ______________________________ Index: vc.el =================================================================== RCS file: /sources/emacs/emacs/lisp/vc.el,v retrieving revision 1.414 diff -w -b -B -c -r1.414 vc.el *** vc.el 7 Feb 2006 16:59:01 -0000 1.414 --- vc.el 5 Apr 2006 21:05:34 -0000 *************** *** 3076,3083 **** nil nil "20"))))))) (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)) (message "Annotating...") ;; If BUF is specified it tells in which buffer we should put the ;; annotations. This is used when switching annotations to another --- 3076,3087 ---- nil nil "20"))))))) (vc-ensure-vc-buffer) (setq vc-annotate-display-mode display-mode) ;Not sure why. --Stef ! (let* ((temp-buffer-setup-hook nil) ! (temp-buffer-name (format "*Annotate %s (rev %s)*" ! (buffer-name) rev)) ! (temp-buffer-show-function (lambda (buf) ! (switch-to-buffer buf) ! (vc-annotate-display-select)))) (message "Annotating...") ;; If BUF is specified it tells in which buffer we should put the ;; annotations. This is used when switching annotations to another *************** *** 3086,3101 **** (rename-buffer temp-buffer-name t) ;; In case it had to be uniquified. (setq temp-buffer-name (buffer-name)))) ! (with-output-to-temp-buffer temp-buffer-name ! (vc-call annotate-command file (get-buffer temp-buffer-name) rev)) (with-current-buffer temp-buffer-name (set (make-local-variable 'vc-annotate-backend) (vc-backend file)) (set (make-local-variable 'vc-annotate-parent-file) file) (set (make-local-variable 'vc-annotate-parent-rev) rev) (set (make-local-variable 'vc-annotate-parent-display-mode) ! display-mode)) ! (message "Annotating... done"))) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one. --- 3090,3108 ---- (rename-buffer temp-buffer-name t) ;; In case it had to be uniquified. (setq temp-buffer-name (buffer-name)))) ! (vc-call annotate-command file (get-buffer-create temp-buffer-name) rev) ! (switch-to-buffer temp-buffer-name) ! (delete-other-windows) ! (vc-annotate-display-select) ! (goto-char (point-min)) (with-current-buffer temp-buffer-name (set (make-local-variable 'vc-annotate-backend) (vc-backend file)) (set (make-local-variable 'vc-annotate-parent-file) file) (set (make-local-variable 'vc-annotate-parent-rev) rev) (set (make-local-variable 'vc-annotate-parent-display-mode) ! display-mode))) ! (message "Annotating... done")) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one.