unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: processes' filter functions and buffers -- data chunks
Date: Mon, 01 Oct 2007 11:36:50 +0200	[thread overview]
Message-ID: <u4phbb2h9.fsf@gnu.org> (raw)
In-Reply-To: <u3awvvpdh.fsf@nokia.com> (message from Peter Tury on Sun, 30 Sep 2007 21:02:02 GMT)

> 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	other threads:[~2007-10-01  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 21:02 processes' filter functions and buffers -- data chunks Peter Tury
2007-10-01  9:36 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u4phbb2h9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).