From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: buffering of process output Date: Sun, 10 Oct 2004 02:08:38 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <20030716.123727.83083338.kazu@iijlab.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1097366969 19859 80.91.229.6 (10 Oct 2004 00:09:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Oct 2004 00:09:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 10 02:09:13 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CGRGy-0006ZL-00 for ; Sun, 10 Oct 2004 02:09:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGRNq-0007lJ-C6 for ged-emacs-devel@m.gmane.org; Sat, 09 Oct 2004 20:16:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CGRNb-0007jU-6X for emacs-devel@gnu.org; Sat, 09 Oct 2004 20:16:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CGRNa-0007hN-1i for emacs-devel@gnu.org; Sat, 09 Oct 2004 20:16:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CGRNZ-0007gq-F6 for emacs-devel@gnu.org; Sat, 09 Oct 2004 20:16:01 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CGRGK-0002aU-6t for emacs-devel@gnu.org; Sat, 09 Oct 2004 20:08:32 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id A0F2847FE33; Sun, 10 Oct 2004 02:08:30 +0200 (CEST) Original-To: Kazu Yamamoto (=?utf-8?b?5bGx5pys5ZKM5b2m?=) In-Reply-To: <20030716.123727.83083338.kazu@iijlab.net> (Kazu Yamamoto =?utf-8?b?KA==?= =?utf-8?b?5bGx5pys5ZKM5b2mKSdz?= message of "Wed, 16 Jul 2003 12:37:27 +0900 (JST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28161 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28161 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. =20 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 (=E5=B1=B1=E6=9C=AC=E5=92=8C=E5=BD=A6) writ= es: > 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 scro= ll bars) > of 2003-07-16 on caster.iij.ad.jp > configured using `configure '--without-xim' '--prefix=3D/usr/local/emacs2= 1' 'CFLAGS=3D-I/usr/pkg/include' 'CPPFLAGS=3D-I/usr/pkg/include -L/usr/pkg/= lib' 'LDFLAGS=3D-R/usr/pkg/lib -L/usr/pkg/lib -R/usr/X11R6/lib -L/usr/X11R6= /lib'' > --=20 Kim F. Storm http://www.cua.dk