From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: vc.el: asynchronous annotations Date: Mon, 16 Jul 2007 01:20:55 +0200 Message-ID: <85k5t12qzs.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1184541676 30153 80.91.229.12 (15 Jul 2007 23:21:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Jul 2007 23:21:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 01:21:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IADOs-0000un-6g for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2007 01:21:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IADOr-0004V2-EZ for ged-emacs-devel@m.gmane.org; Sun, 15 Jul 2007 19:21:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IADOn-0004Ux-It for emacs-devel@gnu.org; Sun, 15 Jul 2007 19:21:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IADOj-0004Ul-V6 for emacs-devel@gnu.org; Sun, 15 Jul 2007 19:21:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IADOj-0004Ui-PY for emacs-devel@gnu.org; Sun, 15 Jul 2007 19:21:05 -0400 Original-Received: from mail-in-03.arcor-online.net ([151.189.21.43]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IADOj-0000rO-6M for emacs-devel@gnu.org; Sun, 15 Jul 2007 19:21:05 -0400 Original-Received: from mail-in-13-z2.arcor-online.net (mail-in-13-z2.arcor-online.net [151.189.8.30]) by mail-in-03.arcor-online.net (Postfix) with ESMTP id 81D9A2CAB00 for ; Mon, 16 Jul 2007 01:21:01 +0200 (CEST) Original-Received: from mail-in-10.arcor-online.net (mail-in-10.arcor-online.net [151.189.21.50]) by mail-in-13-z2.arcor-online.net (Postfix) with ESMTP id 6B5AA1B8E04 for ; Mon, 16 Jul 2007 01:21:01 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-061-010-037.pools.arcor-ip.net [84.61.10.37]) by mail-in-10.arcor-online.net (Postfix) with ESMTP id 2ADE52351A2 for ; Mon, 16 Jul 2007 01:21:01 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 3DD561CE30E9; Mon, 16 Jul 2007 01:20:55 +0200 (CEST) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Virus-Scanned: ClamAV 0.91/3678/Sun Jul 15 23:49:40 2007 on mail-in-10.arcor-online.net X-Virus-Status: Clean X-detected-kernel: Linux 2.4-2.6 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:74864 Archived-At: --=-=-= Hi, I've tried getting asynchronous annotations to work, and basically it is a whole bunch of ... I have gone through with an example backend of my own as well as with vc-cvs (which inexplicably still works synchronously here), so both the asynchronous as well as the synchronous operation should be covered by now. I am not sure I like the behavior when doing P or N or similar in the annotation buffer: since the buffer is reused, it is cleared and filled with new material while being displayed on the screen. There are two ways around that, I guess. One way would be to switch back to the source buffer while the operation progresses. Another way would be to _not_ reuse the buffer but instead delete the old buffer once the new one is complete. Anyway, here is a patch regarding the current working state at my end. Stefan, what do you say? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** vc.el 09 Jul 2007 23:10:04 +0200 1.432 --- vc.el 16 Jul 2007 01:09:39 +0200 *************** *** 3123,3129 **** use; you may override this using the second optional arg MODE." (interactive) (if mode (setq vc-annotate-display-mode mode)) ! (pop-to-buffer (or buffer (current-buffer))) (cond ((null vc-annotate-display-mode) ;; The ratio is global, thus relative to the global color-map. (kill-local-variable 'vc-annotate-color-map) --- 3123,3129 ---- use; you may override this using the second optional arg MODE." (interactive) (if mode (setq vc-annotate-display-mode mode)) ! (if buffer (set-buffer buffer)) (cond ((null vc-annotate-display-mode) ;; The ratio is global, thus relative to the global color-map. (kill-local-variable 'vc-annotate-color-map) *************** *** 3183,3193 **** (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) ! ;; 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 --- 3183,3189 ---- (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)) ! (current-line (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 *************** *** 3196,3221 **** (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) ! ;; we must setup the mode first, and then set our local ! ;; variables before the show-function is called at the exit of ! ;; with-output-to-temp-buffer ! (with-current-buffer temp-buffer-name ! (if (not (equal major-mode 'vc-annotate-mode)) ! (vc-annotate-mode)) ! (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))) ! ! (vc-exec-after ! `(progn ! (when ,current-line ! (goto-line ,current-line ,temp-buffer-name)) ! (unless (active-minibuffer-window) ! (message "Annotating... done")))))) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one. --- 3192,3215 ---- (rename-buffer temp-buffer-name t) ;; In case it had to be uniquified. (setq temp-buffer-name (buffer-name)))) ! (vc-call annotate-command file temp-buffer-name rev) ! ;; we must setup the mode first, and then set our local ! ;; variables before the show-function is called ! (with-current-buffer temp-buffer-name ! (if (not (equal major-mode 'vc-annotate-mode)) ! (vc-annotate-mode)) ! (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) ! (vc-annotate-display-select temp-buffer-name) ! (vc-exec-after ! `(progn ! (goto-line ,current-line ,temp-buffer-name) ! (pop-to-buffer ,temp-buffer-name) ! (unless (active-minibuffer-window) ! (message "Annotating... done"))))))) (defun vc-annotate-prev-version (prefix) "Visit the annotation of the version previous to this one. *************** *** 3312,3318 **** (if (not (equal major-mode 'vc-annotate-mode)) (message "Cannot be invoked outside of a vc annotate buffer") (let* ((buf (current-buffer)) - (oldline (line-number-at-pos)) (revspeccopy revspec) (newrev nil)) (cond --- 3306,3311 ---- *************** *** 3339,3348 **** (when newrev (vc-annotate vc-annotate-parent-file newrev vc-annotate-parent-display-mode ! buf) ! (goto-line (min oldline (progn (goto-char (point-max)) ! (previous-line) ! (line-number-at-pos))) buf))))) (defun vc-annotate-compcar (threshold a-list) "Test successive cons cells of A-LIST against THRESHOLD. --- 3332,3338 ---- (when newrev (vc-annotate vc-annotate-parent-file newrev vc-annotate-parent-display-mode ! buf))))) (defun vc-annotate-compcar (threshold a-list) "Test successive cons cells of A-LIST against THRESHOLD. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--