all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jürgen Hötzel" <juergen@hoetzel.info>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: emacs-devel@gnu.org
Subject: Re: Race condition in eshell-gather-process-output
Date: Sat, 19 Jan 2013 13:31:18 +0100	[thread overview]
Message-ID: <CANmXxHNbCMZLdA9ESv8pQGb6BaBiaEjaRjce3TscmtCZDA6vKg@mail.gmail.com> (raw)
In-Reply-To: <m2txqdwepc.fsf@igel.home>

On Sat, Jan 19, 2013 at 1:16 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Jürgen Hötzel <juergen@archlinux.org> writes:
>
>>             (apply 'start-file-process
>>                    (file-name-nondirectory command) nil
>>                    ;; `start-process' can't deal with relative filenames.
>>                    (append (list (expand-file-name command)) args))))
>> ----------------------------------------------------------------------------------------
>> something can happen meanwhile: The process may have written
>> output (nil output buffer)
>> ----------------------------------------------------------------------------------------
>>
>>       (eshell-record-process-object proc)
>>       (set-process-buffer proc (current-buffer))
>>
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> Maybe too late to set output buffer!
>
> It isn't.  Process output isn't read until accept-process-output is
> called.

I did this test in Eshell:

~ $ bash -c "echo test1 && sleep 1 && echo test2"
test1
test2
~ $

Than inserting a delay in obove code:


....
	      (apply 'start-file-process
		     (file-name-nondirectory command) nil
		     ;; `start-process' can't deal with relative filenames.
		     (append (list (expand-file-name command)) args))))
      (sleep-for 1)
      (eshell-record-process-object proc)
....

results in:

~ $ bash -c "echo test1 && sleep 1 && echo test2"
test2
~ $

missing the first line of output

Regards,

Jürgen



  reply	other threads:[~2013-01-19 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19 11:28 Race condition in eshell-gather-process-output Jürgen Hötzel
2013-01-19 12:16 ` Andreas Schwab
2013-01-19 12:31   ` Jürgen Hötzel [this message]
2013-01-19 15:58     ` Andreas Schwab

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=CANmXxHNbCMZLdA9ESv8pQGb6BaBiaEjaRjce3TscmtCZDA6vKg@mail.gmail.com \
    --to=juergen@hoetzel.info \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.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.