From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Patch to make VC annotate async Date: Mon, 09 Jul 2007 21:09:29 +0200 Message-ID: <85odils8ba.fsf@lola.goethe.zz> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1184008229 2170 80.91.229.12 (9 Jul 2007 19:10:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2007 19:10:29 +0000 (UTC) Cc: Stefan Monnier , 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 21:10:25 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 1I7ycq-0004cN-6A for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 21:10:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7ycp-0004dc-Mk for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 15:10:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7yc8-0004Iy-Au for emacs-devel@gnu.org; Mon, 09 Jul 2007 15:09:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7yc6-0004G7-97 for emacs-devel@gnu.org; Mon, 09 Jul 2007 15:09:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7yc6-0004Fk-5S for emacs-devel@gnu.org; Mon, 09 Jul 2007 15:09:38 -0400 Original-Received: from mail-in-09.arcor-online.net ([151.189.21.49]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I7yc4-0001R6-Rd; Mon, 09 Jul 2007 15:09:37 -0400 Original-Received: from mail-in-14-z2.arcor-online.net (mail-in-14-z2.arcor-online.net [151.189.8.31]) by mail-in-09.arcor-online.net (Postfix) with ESMTP id 37062303528; Mon, 9 Jul 2007 21:09:35 +0200 (CEST) Original-Received: from mail-in-10.arcor-online.net (mail-in-10.arcor-online.net [151.189.21.50]) by mail-in-14-z2.arcor-online.net (Postfix) with ESMTP id 1EBBB100C4; Mon, 9 Jul 2007 21:09:35 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-061-064-204.pools.arcor-ip.net [84.61.64.204]) by mail-in-10.arcor-online.net (Postfix) with ESMTP id 9DD7324D829; Mon, 9 Jul 2007 21:09:34 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 7B2751C408CD; Mon, 9 Jul 2007 21:09:30 +0200 (CEST) In-Reply-To: (Tom Tromey's message of "Mon\, 09 Jul 2007 09\:12\:00 -0600") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Virus-Scanned: ClamAV 0.90.3/3615/Mon Jul 9 16:28:23 2007 on mail-in-10.arcor-online.net X-Virus-Status: Clean X-detected-kernel: Linux 2.4-2.6 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:74520 Archived-At: Tom Tromey writes: >>>>>> "Stefan" == Stefan Monnier writes: > > Stefan> For the vc-cvs.el part of the patch , can you try the patch below? > > I haven't tried it yet, but I do have a question. > > Stefan> +(defun vc-cvs-annotate-process-filter (process string) > Stefan> + (setq string (concat (process-get process 'output) string)) > Stefan> + (if (not (string-match "^[0-9]" string)) > Stefan> + ;; Still waiting for the first real line. > Stefan> + (process-put process 'output string) > Stefan> + ;; FIXME: we shouldn't hardcode vc-process-filter here. > Stefan> + (set-process-filter process 'vc-process-filter) > Stefan> + (vc-process-filter process (substring string (match-beginning 0))))) > > I had written a much more complicated filter because my reading of the > Elisp manual is that the output from the process won't necessarily > appear as full lines. Is that not so? Correct. But the above does wait for a complete line, followed by a newline followed by [0-9], then calls the filter function on everything up to there. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum