From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Milan Zamazal Newsgroups: gmane.emacs.help Subject: Re: Accepting process output from a given process only? Date: Sun, 08 Aug 2004 20:47:46 +0200 Organization: BRAILCOM, o.p.s. Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87llgp1n71.fsf@zamazal.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1091990918 29686 80.91.224.253 (8 Aug 2004 18:48:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 Aug 2004 18:48:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 08 20:48:30 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Btsic-0000xF-00 for ; Sun, 08 Aug 2004 20:48:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BtsmK-0004oi-Aj for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Aug 2004 14:52:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BtsmA-0004mV-Ew for help-gnu-emacs@gnu.org; Sun, 08 Aug 2004 14:52:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Btsm7-0004kb-V6 for help-gnu-emacs@gnu.org; Sun, 08 Aug 2004 14:52:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Btsm7-0004kW-RD for help-gnu-emacs@gnu.org; Sun, 08 Aug 2004 14:52:07 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Btshz-0002xp-Mc for help-gnu-emacs@gnu.org; Sun, 08 Aug 2004 14:47:52 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Btshy-0005OA-00 for ; Sun, 08 Aug 2004 20:47:50 +0200 Original-Received: from r2ao37.chello.upc.cz ([62.245.104.37]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Aug 2004 20:47:50 +0200 Original-Received: from pdm by r2ao37.chello.upc.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Aug 2004 20:47:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: r2ao37.chello.upc.cz X-Face: >kl&pL}(a*u\BCj7Q, \Yoq35~, 4dAu"CPGaJ[ahMli9uu#aF7dWxc3L.eaK2RWRU|', E+. -':&gJ-JAZ/N$f^4-3?G7M&Knna[A=lJ$}^!%@vuvulVl6-)x.V8RZ7fW9< User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:+7yzNWfYmbA5kKbRiVi8qy4HF44= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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 Xref: main.gmane.org gmane.emacs.help:20033 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20033 >>>>> "SM" == Stefan Monnier writes: >> I'd like to receive output from an asynchronous process, but >> without possible invocation of other asynchronous actions. If I >> simply call accept-process-output, other process filter functions >> or timers may be invoked at that time, which is what I need to >> avoid. SM> There's no such feature. Could you explain what you need it for SM> (i.e. why it is bad to process other processes's output at the SM> same point in the program)? I write an Emacs speech output system, which communicates with a speech synthesis system via a network process. The problem is that, due to possible multiple process processing in accept-process-output, many process filter functions must be reentrant. Imagine the following (real) scenario: Some Emacs command, let's say foo, opens a network connection, reads data from the socket and reports progress to the user via `message' in its filter function. The `message' function is, naturally, advised by the speech output system, which talks to the synthesizer and reads its answer immediately, i.e. it calls accept-process-output. But the accept-process-output call may invoke foo's filter function again, i.e. the foo's filter function is invoked within its previous invocation. If the foo's filter function is not reentrant, foo may end up with an error. If I could call accept-process-output in the speech output system without the danger of other filter function and/or timer invocation, then foo would be safe. Moreover, the speech output system needn't be reentrant itself, so it could be simplified. Regards, Milan Zamazal -- The rush to reproduce Microsofts window environment seems to overshadow the design process of determining what a window environment should be, and what its ultimate users will want. -- Barry Fishman in gnu.misc.discuss