From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.help Subject: Re: start-process and set-process-filter sequence Date: Fri, 15 Apr 2011 10:16:09 +0800 Organization: the Church of Emacs Message-ID: <21glipugs1hy.fsf@gmail.com> References: <21glbp094jfn.fsf@gmail.com> <878vvdpgbo.fsf@gmail.com> <21gl39ll44z8.fsf@gmail.com> <87ipuh59ck.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1302834322 20664 80.91.229.12 (15 Apr 2011 02:25:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Apr 2011 02:25:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 15 04:25:16 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QAYih-0004to-9h for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Apr 2011 04:25:15 +0200 Original-Received: from localhost ([::1]:55708 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAYig-0002iN-SY for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Apr 2011 22:25:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAYib-0002iH-3r for help-gnu-emacs@gnu.org; Thu, 14 Apr 2011 22:25:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAYiZ-0001Yr-W5 for help-gnu-emacs@gnu.org; Thu, 14 Apr 2011 22:25:09 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:56067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAYiZ-0001Yb-Mm for help-gnu-emacs@gnu.org; Thu, 14 Apr 2011 22:25:07 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QAYiY-0004rL-SF for help-gnu-emacs@gnu.org; Fri, 15 Apr 2011 04:25:06 +0200 Original-Received: from esprx01x.nokia.com ([192.100.124.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Apr 2011 04:25:06 +0200 Original-Received: from william.xwl by esprx01x.nokia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Apr 2011 04:25:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: esprx01x.nokia.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) Cancel-Lock: sha1:PR3ZMyZfwbTN7NUYLJaGI+OaK/M= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80799 Archived-At: Thien-Thi Nguyen writes: Process output is distributed to filters when Emacs has nothing else to do, such as when pausing for interaction (‘read-string’ et al). (You can also explicitly request it via ‘accept-process-output’ but that is not germane.) So the best strategy is to not allow such pauses in the first place. E.g., you could add an abstraction ‘start-filtered-process’ and make sure you use ‘start-filtered-process’ everywhere you'd normally use a naked ‘start-process’. I see, Thanks. It looks like a bug or shortcoming, though. I was expecting the sequence to be similar to this: ,---- | Filter *filter = new Filter; | Process *proc = new Process(filter); | proc->start(); `---- -- William http://xwl.appspot.com