From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frank Fischer Newsgroups: gmane.emacs.help Subject: How to flush output to process Date: Sun, 6 Nov 2011 09:53:39 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1320573929 32505 80.91.229.12 (6 Nov 2011 10:05:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Nov 2011 10:05:29 +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 11:05:26 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 1RMzbR-000766-FR for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Nov 2011 11:05:25 +0100 Original-Received: from localhost ([::1]:59086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMzbR-0001wW-1R for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Nov 2011 05:05:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMzbM-0001gF-3V for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 05:05:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMzbA-00039d-Dx for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 05:05:09 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:42429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMzbA-000394-8m for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 05:05:08 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RMzb8-0006zj-Vd for help-gnu-emacs@gnu.org; Sun, 06 Nov 2011 11:05:06 +0100 Original-Received: from mordred.mathematik.tu-chemnitz.de ([134.109.40.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Nov 2011 11:05:06 +0100 Original-Received: from frank-fischer by mordred.mathematik.tu-chemnitz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Nov 2011 11:05:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: mordred.mathematik.tu-chemnitz.de User-Agent: slrn/0.9.9p1 (Linux) 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:82769 Archived-At: Hi, I have a question about communication with processes. I want to start an external program from Emacs Lisp in a process (using `start-file-process'). This program accepts input data from stdin and writes its results to stdout. After sending data to the process using `process-send-string' nothing happens if the data does not end in a newline character. The problem is that in general I cannot end every request I send to the process with a newline (a constraint of the communication protocol) and using `process-send-eof' is also not an option because this seems to close the connection completely (I want to communicate with the process in several turns). 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? Thanks in advance, Frank