🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #325

Re: PLEASE TRY THIS PATCH

#325
From: blueman
Date: Mon, 11 Jan 2010 16:28
71 lines
5382 bytes
Uday S Reddy <uDOTsDOTreddy@cs.bham.ac.uk> writes:
> blueman wrote:
> Even now, the important part from my yesterday's message was asking
> you to look at the Elisp manual on *receiving output from
> processes*. I don't know whether you have seen it and are acting on
> it.
I looked at it -- but that is not the problem. In that it hangs even on
sending >64K chunks to a process (as mentioned in another email). Now
one could rewrite the code to process messages in small chunks and wait
to accept output between chunks (although for commands other than cat,
the relationship between input and output data is not generally 1-1) but
this really seems to be an ntEmacs errror as is so clearly demonstrated
by my code.

>
> I repeat again my previous statement that this mode of communication
> is not very effective.  The newsgroup looks like a noisy channel where
> only a small fraction of what we write seems to reach the intended
> destination.  Can we move this to *launchpad bugs* please?  It will
> take you only a minute or two to register, and you can open a bug
> report.

I will do that for future bugs but since this one has such a long
history and in my opinion has been pretty much relegated to an ntEmacs
issue I would prefer not to now. I will register though when I get a chance.

>> The problem must be because you are generating more than a 64K page of
>> output...
>
> The problem is that the current code is faulty.  It is making no
> effort to accept output from the process until the very end.  So, it
> clogs up the OS buffers.  The fact that it works for some examples on
> some OS environments doesn't make it right.

The manual in my opinion is perhaps a bit vague on when you need to use
accept-process. But it really is not necessary and indeed processes
send their output without it (as evidenced by my 2-liner of code).

Per the manual:
    Output from asynchronous subprocesses normally arrives only while Emacs
    is waiting for some sort of external event, such as elapsed time or
    terminal input.  Occasionally it is useful in a Lisp program to
    explicitly permit output to arrive at a specific point, or even to wait
    until output arrives from a process.
NOTE the word *occassionally* -- accepting output is *not* required
unless you want it "to arrive at a specific point" -- and I don't consider
not wanting to wait forever to be a "specific" point ;)

Nowhere in the manual is any limitation mentioned on size -- and in fact
it would be ridiculous to think that the correct usage of
process-send-region has such egregious limitations on buffer size and
requires the user to implement some undefined OS-specific buffering scheme.

I have submitted the bug to the ntemacs mailing list.

>
>>> If you look up the ELisp manual section on "Receiving output from
>>> processes", you should be able to code this more safely.
>
> Let me highlight this once again!!!
>
> The discard-output issue you raised in the other thread is
> independent.  But I think that once you figure out how to solve the
> current problem, you will also have a better solution for the
> discard-output.
>
Agreed that it is independent. And I know how I *want* to code it. I
just don't want to do it unless you are open to the types of changes I
am suggesting. And I would rather not rewrite the code twice -- once to
fix this hanging problem (though I believe it is not a vm problem at
all) and once to fix the use of DISCARD-OUTPUT.
Technical Details
Message-ID: <m26378txm6.fsf@consult.pretender>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
References: <m2d41p7sho.fsf@consult.pretender> <hi2c72$l5i$1@north.jnrs.ja.net> <m2ocl7yvsr.fsf@consult.pretender> <hi4d25$81f$1@north.jnrs.ja.net> <m24omxzybc.fsf@consult.pretender> <hi54kr$euu$1@north.jnrs.ja.net> <m2r5q1ybz4.fsf@consult.pretender> <m2my0pybcx.fsf@consult.pretender> <hi5peg$kmp$1@north.jnrs.ja.net> <m2iqbdxbuj.fsf@consult.pretender> <hi73bg$1cs$1@north.jnrs.ja.net> <m2aawownfr.fsf_-_@consult.pretender> <hi80m7$9sa$1@north.jnrs.ja.net> <m2pr5kuzoi.fsf@consult.pretender> <hi88sr$c2j$1@north.jnrs.ja.net> <m28wc6vncg.fsf@consult.pretender> <hicmei$h4k$1@north.jnrs.ja.net> <m2my0mt133.fsf@consult.pretender> <hid1l2$k9c$1@north.jnrs.ja.net> <m2iqb9tg1d.fsf@consult.pretender> <hienfg$3nc$1@north.jnrs.ja.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: a16957f451,747cd7667796b3e3
X-Google-Attributes: gida16957f451,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: blueman <NOSPAM@nospam.com>
Newsgroups: gnu.emacs.vm.bug
Subject: Re: PLEASE TRY THIS PATCH
Date: Mon, 11 Jan 2010 11:28:01 -0500
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <m26378txm6.fsf@consult.pretender>
References: <m2d41p7sho.fsf@consult.pretender>
 <hi2c72$l5i$1@north.jnrs.ja.net> <m2ocl7yvsr.fsf@consult.pretender>
 <hi4d25$81f$1@north.jnrs.ja.net> <m24omxzybc.fsf@consult.pretender>
 <hi54kr$euu$1@north.jnrs.ja.net> <m2r5q1ybz4.fsf@consult.pretender>
 <m2my0pybcx.fsf@consult.pretender> <hi5peg$kmp$1@north.jnrs.ja.net>
 <m2iqbdxbuj.fsf@consult.pretender> <hi73bg$1cs$1@north.jnrs.ja.net>
 <m2aawownfr.fsf_-_@consult.pretender> <hi80m7$9sa$1@north.jnrs.ja.net>
 <m2pr5kuzoi.fsf@consult.pretender> <hi88sr$c2j$1@north.jnrs.ja.net>
 <m28wc6vncg.fsf@consult.pretender> <hicmei$h4k$1@north.jnrs.ja.net>
 <m2my0mt133.fsf@consult.pretender> <hid1l2$k9c$1@north.jnrs.ja.net>
 <m2iqb9tg1d.fsf@consult.pretender> <hienfg$3nc$1@north.jnrs.ja.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Mon, 11 Jan 2010 16:28:02 +0000 (UTC)
Injection-Info: news.motzarella.org; posting-host="o0xooYC/dlyFpPxuXQpbEw";
 logging-data="6784"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dZyI8dQFDS+JiZom0qmFSvlUwckE/Fr4="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:jAB4GEoWG2xFnGV2ck3EaPbu1QY=
 sha1:A5mpOZtYa8krGeaSytcqIVg19ZM=