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: Sat, 07 Jul 2007 17:06:57 -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 1183955432 17436 80.91.229.12 (9 Jul 2007 04:30:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2007 04:30:32 +0000 (UTC) Cc: spiegel@gnu.org, Emacs Hackers To: tromey@redhat.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 09 06:30:31 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 1I7ktG-0000LA-PJ for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 06:30:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7ktG-0000sR-Cq for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 00:30:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7ktD-0000qq-Cj for emacs-devel@gnu.org; Mon, 09 Jul 2007 00:30:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7ktC-0000q4-L2 for emacs-devel@gnu.org; Mon, 09 Jul 2007 00:30:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7ktC-0000q0-Gi for emacs-devel@gnu.org; Mon, 09 Jul 2007 00:30:22 -0400 Original-Received: from tomts10.bellnexxia.net ([209.226.175.54] helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I7ktA-0002Qz-Sc; Mon, 09 Jul 2007 00:30:21 -0400 Original-Received: from ceviche.home ([70.55.81.241]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070709043019.VJIP9197.tomts10-srv.bellnexxia.net@ceviche.home>; Mon, 9 Jul 2007 00:30:19 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 15AB7B411F; Sat, 7 Jul 2007 17:06:57 -0400 (EDT) In-Reply-To: (Tom Tromey's message of "Sat\, 23 Jun 2007 20\:32\:11 -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:74487 Archived-At: 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