[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to make VC annotate async

From: Stefan Monnier
Subject: Re: Patch to make VC annotate async
Date: Sun, 24 Jun 2007 21:34:27 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>>> * 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
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.
     '(let ((inhibit-read-only t))
          (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]