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: processes' filter functions and buffers -- data chunks Date: Mon, 01 Oct 2007 11:36:50 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1191231469 18831 80.91.229.12 (1 Oct 2007 09:37:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2007 09:37:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 11:37:43 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IcHig-0005G9-IF for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Oct 2007 11:37:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IcHic-0007yw-CK for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Oct 2007 05:37:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IcHhw-0007qS-QO for help-gnu-emacs@gnu.org; Mon, 01 Oct 2007 05:36:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IcHhv-0007pc-6O for help-gnu-emacs@gnu.org; Mon, 01 Oct 2007 05:36:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IcHhu-0007pZ-TD for help-gnu-emacs@gnu.org; Mon, 01 Oct 2007 05:36:54 -0400 Original-Received: from heller.inter.net.il ([213.8.233.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IcHhu-0000El-6o for help-gnu-emacs@gnu.org; Mon, 01 Oct 2007 05:36:54 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-23-193.inter.net.il [80.230.23.193]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id DTG04609 (AUTH halo1); Mon, 1 Oct 2007 11:36:47 +0200 (IST) In-reply-to: (message from Peter Tury on Sun, 30 Sep 2007 21:02:02 GMT) X-Detected-Kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48016 Archived-At: > From: Peter Tury > Date: Sun, 30 Sep 2007 21:02:02 GMT > > I read in (elisp)Filter Functions that "[A process'] output to the > [filter] function may come in chunks of any size. A program that > produces the same output twice in a row may send it as one batch of > 200 characters one time, and five batches of 40 characters the next." > > What determines how and why this splitting happens? Is this an Emacs > feature? Or depends only on the process (e.g. the program what Emacs > connects to)? Or is this OS-dependent? I think this is system-specific buffering of the pipe/pty used by Emacs to communicate with subordinate processes. > However, output is OK (=always showed up completely) in "Command/DOS > windows" AFAIK, that's because output to the console is normally line-buffered or unbuffered, while pipes are usually fully buffered. > I found this "unpredictable" splitting quite annoying and I don't know > if I have chance to avoid this behaviour by modifying the peer program > or I absolutely have to live with this feature? If you can modify the subordinate program so that it uses less aggressive buffering on its stdout/stderr, you _may_ see some improvement (but not with certainty, since some of the buffering is in the filesystem, not in the application). But I think this solution is impractical, since most programs cannot be practically changed in such a way.