From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to flush output to process Date: Sun, 06 Nov 2011 06:07:17 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1320577648 20306 80.91.229.12 (6 Nov 2011 11:07:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Nov 2011 11:07:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 06 12:07:23 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 1RN0ZP-0003bc-Li for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Nov 2011 12:07:23 +0100 Original-Received: from localhost ([::1]:40270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN0ZP-0003IM-2I for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Nov 2011 06:07:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN0ZK-0003I4-Fx for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 06:07:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RN0ZJ-0002eQ-Ep for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 06:07:18 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:45910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RN0ZJ-0002eM-DI for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 06:07:17 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RN0ZJ-0006TO-79 for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 06:07:17 -0500 In-reply-to: (message from Frank Fischer on Sun, 6 Nov 2011 09:53:39 +0000 (UTC)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:82770 Archived-At: > 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.