From: Stefan Monnier <monnier@iro.umontreal.ca>
To: tromey@redhat.com
Cc: spiegel@gnu.org, Emacs Hackers <emacs-devel@gnu.org>
Subject: Re: Patch to make VC annotate async
Date: Sat, 07 Jul 2007 17:06:57 -0400 [thread overview]
Message-ID: <jwvvecwnd2z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3d4zm3wwk.fsf@fleche.redhat.com> (Tom Tromey's message of "Sat\, 23 Jun 2007 20\:32\:11 -0600")
For the vc-cvs.el part of the patch , can you try the patch below?
Also I noticed that my own version used vc-exec-after because that makes it
work both for async and sync and I select between the two with
(if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
Not sure if it matters.
Stefan
--- vc-cvs.el 26 jan 2007 23:51:27 -0500 1.80
+++ vc-cvs.el 07 jui 2007 17:00:40 -0400
@@ -588,14 +591,22 @@
(and rev2 (concat "-r" rev2))
(vc-switches 'CVS 'diff))))))
+(defun vc-cvs-annotate-process-filter (process string)
+ (setq string (concat (process-get process 'output) string))
+ (if (not (string-match "^[0-9]" string))
+ ;; Still waiting for the first real line.
+ (process-put process 'output string)
+ ;; FIXME: we shouldn't hardcode vc-process-filter here.
+ (set-process-filter process 'vc-process-filter)
+ (vc-process-filter process (substring string (match-beginning 0)))))
+
(defun vc-cvs-annotate-command (file buffer &optional version)
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
Optional arg VERSION is a version to annotate from."
- (vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version)))
- (with-current-buffer buffer
- (goto-char (point-min))
- (re-search-forward "^[0-9]")
- (delete-region (point-min) (1- (point)))))
+ (vc-cvs-command buffer 'async file "annotate"
+ (if version (concat "-r" version)))
+ (set-process-filter (get-buffer-process buffer)
+ 'vc-cvs-annotate-process-filter))
(defun vc-cvs-annotate-current-time ()
"Return the current time, based at midnight of the current day, and
next prev parent reply other threads:[~2007-07-07 21:06 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
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 [this message]
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=jwvvecwnd2z.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=spiegel@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.