all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: fgallina@gnu.org (Fabián Ezequiel Gallina)
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r117592: Grab all Python process output before inferior-python-mode hooks.
Date: Thu, 31 Jul 2014 02:54:06 -0400	[thread overview]
Message-ID: <jwv1tt2yqbh.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <877g2up8e4.fsf@gnu.org> ("Fabián Ezequiel Gallina"'s message of "Wed, 30 Jul 2014 23:30:27 -0300")

> What it seems to be happening is that on the first accept-process-output
> call, the output that is grabbed is just the banner, leaving the prompt
> outside, and that's what the sit-for was actually "fixing".  The truth
> is (I think) that sit-for should be another accept-process-output call.

Actually, there's no guarantee that the two chunks that are sent by
Python will be received as 2 chunks by Emacs.  It all depends on the OS
and timing and buffering.  It could be received as a single chunk
(typically if Emacs gets to run "late" enough that both chunks have
already been sent), or it could be further divided by the OS into
smaller chunks (typically if the chunks are large).

So you should use a loop, which checks the actual text received, looking
for a tell-tale sign (e.g. a prompt) that "we've received all we need so
far".


        Stefan



      reply	other threads:[~2014-07-31  6:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1XBayX-0002IL-CG@vcs.savannah.gnu.org>
2014-07-28  8:18 ` [Emacs-diffs] trunk r117592: Grab all Python process output before inferior-python-mode hooks Stefan Monnier
2014-07-28 21:12   ` Fabián Ezequiel Gallina
2014-07-28 23:21     ` Stefan Monnier
2014-07-31  2:30       ` Fabián Ezequiel Gallina
2014-07-31  6:54         ` Stefan Monnier [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

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

  git send-email \
    --in-reply-to=jwv1tt2yqbh.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=fgallina@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.