From: Stefan Monnier <monnier@iro.umontreal.ca>
To: tromey@redhat.com
Cc: Emacs Hackers <emacs-devel@gnu.org>
Subject: Re: Patch to make VC annotate async
Date: Sun, 24 Jun 2007 21:34:27 -0400 [thread overview]
Message-ID: <jwvy7i8vnd2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m33b0h11kf.fsf@fleche.redhat.com> (Tom Tromey's message of "Sun\, 24 Jun 2007 15\:32\:00 -0600")
>>> * 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
next prev parent reply other threads:[~2007-06-25 1:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 2:32 Patch to make VC annotate async Tom Tromey
2007-06-24 17:35 ` Richard Stallman
2007-06-24 18:05 ` Tom Tromey
2007-06-24 23:47 ` Richard Stallman
2007-06-24 19:33 ` Stefan Monnier
2007-06-24 21:32 ` Tom Tromey
2007-06-25 1:34 ` Stefan Monnier [this message]
2007-06-25 15:24 ` Tom Tromey
2007-06-25 16:54 ` Stefan Monnier
2007-06-25 17:53 ` Tom Tromey
2007-06-26 17:48 ` Stefan Monnier
2007-07-07 21:06 ` Stefan Monnier
2007-07-09 15:12 ` Tom Tromey
2007-07-09 19:09 ` David Kastrup
2007-07-11 16:02 ` Tom Tromey
2007-07-12 3:15 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy7i8vnd2.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.