From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.help Subject: Re: How to flush output to process Date: Sun, 06 Nov 2011 19:21:50 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332967356 4660 80.91.229.3 (28 Mar 2012 20:42:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2012 20:42:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 28 22:42:35 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SCzhQ-0008EZ-5q for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2012 22:42:32 +0200 Original-Received: from localhost ([::1]:35761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCzhP-00071j-Fv for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2012 16:42:31 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.kpnqwest.it!news.kpnqwest.it.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 06 Nov 2011 12:21:49 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:xzrjkCbQ8NmyMhsJtTgxTd4N9L8= Original-Lines: 37 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 212.46.176.167 Original-X-Trace: sv3-ELiuicJ8tC5C0abT0qBbJ2lejHzPqI6KecFvVB74vxpCKDAyWMV5HcIrn/wU+et59yw7LMTSGQNS/84!2A5Ti+WmQsTJ2kFpbC2HUhJ1YwWAkyrVtaV1n01z2AYsk8qgQWx9slcMKhVRr/E= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2600 Original-Xref: usenet.stanford.edu gnu.emacs.help:189656 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:84160 Archived-At: * Frank Fischer [2011-11-06 11:38] writes: > Am Sun, 06 Nov 2011 06:07:17 -0500 > schrieb Eli Zaretskii : > >> > From: Frank Fischer >> > Date: Sun, 6 Nov 2011 09:53:39 +0000 (UTC) >> > >> > In something like C I would use fflush(...) to force the buffered >> > data to be sent to the process (and it works), but I have not been >> > able to find some comparable function for Emacs Lisp. >> > >> > Is there a way the flush the Emacs->process stream, i.e., force all >> > buffered data to be actually send to the process, from Emacs Lisp? >> >> I'm guessing that your analysis of the problem (and therefore the >> solution you are seeking) is incorrect. I think it's the sub-process >> who is buffering input until it sees a newline. >> >> To fix this, make sure your subprocess reads its stdin in raw mode, >> not in cooked mode. > > Well, I cannot change the subprocess' code. But even if it is a problem > of the subprocess, why does it work if I communicate with the > subprocess from some other program, i.e., not starting the process from > Emacs but from some other programming language, AND call the flush > function of the corresponding stream? process-send-string does no buffering. > Btw, I would be surprised if it is indeed a problem of the subprocess > as it is designed to be used in this way. Maybe it's an end-of-line conversion issue. The subprocess may expect \r\n on end-of-line. What's the process-coding-system? Helmut