help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: processes' filter functions and buffers -- data chunks


From: Eli Zaretskii
Subject: Re: processes' filter functions and buffers -- data chunks
Date: Mon, 01 Oct 2007 11:36:50 +0200

> From: Peter Tury <tury.peter@gmail.com>
> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]