From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Patch to make VC annotate async Date: Sun, 24 Jun 2007 21:34:27 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182735279 24992 80.91.229.12 (25 Jun 2007 01:34:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2007 01:34:39 +0000 (UTC) Cc: Emacs Hackers To: tromey@redhat.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 25 03:34:36 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 1I2dTQ-0000vU-BP for ged-emacs-devel@m.gmane.org; Mon, 25 Jun 2007 03:34:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2dTP-0007OD-8o for ged-emacs-devel@m.gmane.org; Sun, 24 Jun 2007 21:34:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2dTL-0007O8-IR for emacs-devel@gnu.org; Sun, 24 Jun 2007 21:34:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2dTJ-0007Nw-TV for emacs-devel@gnu.org; Sun, 24 Jun 2007 21:34:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2dTJ-0007Ns-P3 for emacs-devel@gnu.org; Sun, 24 Jun 2007 21:34:29 -0400 Original-Received: from tomts25.bellnexxia.net ([209.226.175.188] helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I2dTJ-0002QK-AB for emacs-devel@gnu.org; Sun, 24 Jun 2007 21:34:29 -0400 Original-Received: from ceviche.home ([74.12.206.238]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070625013427.OIQN25739.tomts25-srv.bellnexxia.net@ceviche.home> for ; Sun, 24 Jun 2007 21:34:27 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 79416B4B9B; Sun, 24 Jun 2007 21:34:27 -0400 (EDT) In-Reply-To: (Tom Tromey's message of "Sun\, 24 Jun 2007 15\:32\:00 -0600") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:73787 Archived-At: >>> * vc.el (vc-annotate-display-select): Don't pop to buffer if one >>> is specified. >>> (vc-annotate): Run vc-annotate-display-select via vc-exec-after. Stefan> Oh, so you don't even add the coloring until after the whole data Stefan> was received. Hmmm... > Yes. This seemed like the simplest change, and after trying it a bit > I felt that it didn't make the user interface unacceptably odd. The > weirdest bit is when point moves, but that is nice once you adjust to > it. > I also experimented a bit with how the buffer is displayed. In > particular I tried making it so that the buffer is displayed only > after the contents are fontified. I didn't like this since it means > the buffer is hidden while I do other tasks; popping it immediately is > less intrusive -- when the buffer is initially hidden I found that I > could sometimes context switch and forget that I had asked for the > annotation. So it looks like my patch is orthogonal: what it does is move the highlighting to font-lock so that it can be done on-the-fly, and tweak the oldest/youngest calculation so that it is also done on the fly (from the process-filter). So adding it to yours would simply cause the unfinished buffer to already be fontified. > Also, in my various tests, I find that the buffer contents actually > show up reasonably quickly. I introduced the async behaviuor specifically because the buffer content didn't show up quickly in my use case (which was mostly interacting with the Emacs CVS repository). > The slowdown with svn seems to come while computing the text to send; once > sent it seems to arrive quickly enough that I don't notice the contents > not being fontified. In the case of CVS, the annotated text is sent directly from the server, so the rhythm at which it arrives depends on the speed of your connection. Maybe SVN computes the annotated text locally, in which case the network connection would only be involved before the result starts showing up. But then I wonder: why did you bother to introduce this async patch (since you seem to find the "context switch" to something else to be a problem rather than a feature)? > The CVS annotator strips some text from the front of the buffer. I > chose this approach since it means the user will not see the text > being stripped. But, since the text does show up so quickly, and > since the code would be simpler, I could change this to a simple > vc-exec-after if you like. Oh, I see, I had completely forgotten about it, but yes I have it written as: (with-current-buffer buffer ;; FIXME: it'd be even better to do it in the process-filter. (vc-exec-after '(let ((inhibit-read-only t)) (save-excursion (goto-char (point-min)) (re-search-forward "^[0-9]") (delete-region (point-min) (1- (point))))))) so at least at that point I thought it would be better to do it like you did. Stefan