unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: buffering of process output
Date: Sun, 10 Oct 2004 02:08:38 +0200	[thread overview]
Message-ID: <m38yafbfjt.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <20030716.123727.83083338.kazu@iijlab.net> (Kazu Yamamoto (山本和彦)'s message of "Wed, 16 Jul 2003 12:37:27 +0900 (JST)")


I have tried your example on gnu/linux, and I can confirm your
findings for CVS emacs under X.  (I don't have 20.7)

But if I try your example with 'emacs -nw', then CVS emacs runs
smoothly too.  Wierd!!!

It seems that the difference in buffering in X vs. -nw is in the call
to emacs_read, i.e. in the call to read.  But 20.7 seems to do exactly
the same calls.

I have yet to find a sensible explanation why CVS emacs buffers output
differently with X.
 
So I wonder if X somehow causes read from a pipe to buffer things
differently [line buffering perhaps] (or the pipe to be setup
differently)?

I also tried to do (set-buffer-multibyte nil) before call-process:

- CVS emacs under X becomes much worse (seems to have to collect 16K
  output before updating)

- CVS emacs -nw still runs smoothly.

So unibyte/multibyte also kicks in somehow...

Ideas anyone ??


Kazu Yamamoto (山本和彦) <kazu@iijlab.net> writes:

> Emacs 21 has a different behavior of buffering of process output from
> Emacs 20.7.
>
> Evaluate the following in the *scratch* buffer
>
> 	(call-process "ping" nil t t "localhost")
>
> On Emacs 20.7, each line is smoothly inserted every second.
>
> On Emacs 21.3.50, however, insertion is awkward.
>
> --Kazu
>
> ----
> In GNU Emacs 21.3.50.1 (i386-unknown-netbsdelf1.6T, X toolkit, Xaw3d scroll bars)
>  of 2003-07-16 on caster.iij.ad.jp
> configured using `configure '--without-xim' '--prefix=/usr/local/emacs21' 'CFLAGS=-I/usr/pkg/include' 'CPPFLAGS=-I/usr/pkg/include -L/usr/pkg/lib' 'LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib -R/usr/X11R6/lib -L/usr/X11R6/lib''
>

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

       reply	other threads:[~2004-10-10  0:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030716.123727.83083338.kazu@iijlab.net>
2004-10-10  0:08 ` Kim F. Storm [this message]
2004-10-10 14:09   ` buffering of process output Andreas Schwab
2004-10-10 22:36     ` Kim F. Storm
2004-10-11  8:37       ` Kim F. Storm

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=m38yafbfjt.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).