all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Query about call-process
@ 2018-03-30 18:47 Narendra Joshi
  2018-03-30 19:44 ` Philipp Stephani
  0 siblings, 1 reply; 7+ messages in thread
From: Narendra Joshi @ 2018-03-30 18:47 UTC (permalink / raw
  To: help-gnu-emacs

Hi,

The document string for `call-process' says that
>           You can’t directly specify a buffer to put the error output
>           in; that is too difficult to implement.  But you can achieve
>           this result by sending the error output to a temporary file
>           and then inserting the file into a buffer when the subprocess
>           finishes.

I would like to understand what makes doing this difficult? 

Thanks,
-- 
Narendra Joshi



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-03-30 18:47 Query about call-process Narendra Joshi
@ 2018-03-30 19:44 ` Philipp Stephani
  2018-03-30 21:21   ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2018-03-30 19:44 UTC (permalink / raw
  To: Narendra Joshi; +Cc: help-gnu-emacs

Narendra Joshi <narendraj9@gmail.com> schrieb am Fr., 30. März 2018 um
20:49 Uhr:

> Hi,
>
> The document string for `call-process' says that
> >           You can’t directly specify a buffer to put the error output
> >           in; that is too difficult to implement.  But you can achieve
> >           this result by sending the error output to a temporary file
> >           and then inserting the file into a buffer when the subprocess
> >           finishes.
>
> I would like to understand what makes doing this difficult?
>

It requires a select loop because you'd have to read from the stdout and
stderr pipe simultaneously. For the same reason, standard input also has to
come from a file.
Though the argument is a bit weird because `make-process' can do exactly
that. It would just require changing `call-process' to use a select loop to
achieve the same effect.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-03-30 19:44 ` Philipp Stephani
@ 2018-03-30 21:21   ` Eli Zaretskii
  2018-03-30 21:24     ` Philipp Stephani
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-03-30 21:21 UTC (permalink / raw
  To: help-gnu-emacs

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Fri, 30 Mar 2018 19:44:25 +0000
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> Though the argument is a bit weird because `make-process' can do exactly
> that. It would just require changing `call-process' to use a select loop to
> achieve the same effect.

Once you change call-process to do the same as make-process, what
would be the difference between those two?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-03-30 21:21   ` Eli Zaretskii
@ 2018-03-30 21:24     ` Philipp Stephani
  2018-03-31  7:41       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2018-03-30 21:24 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 30. März 2018 um 23:22 Uhr:

> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Fri, 30 Mar 2018 19:44:25 +0000
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >
> > Though the argument is a bit weird because `make-process' can do exactly
> > that. It would just require changing `call-process' to use a select loop
> to
> > achieve the same effect.
>
> Once you change call-process to do the same as make-process, what
> would be the difference between those two?
>
>
call-process would still wait for the process to finish.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-03-30 21:24     ` Philipp Stephani
@ 2018-03-31  7:41       ` Eli Zaretskii
  2018-04-01 17:21         ` Philipp Stephani
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-03-31  7:41 UTC (permalink / raw
  To: help-gnu-emacs

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Fri, 30 Mar 2018 21:24:00 +0000
> Cc: help-gnu-emacs@gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 30. März 2018 um 23:22 Uhr:
> 
>  > From: Philipp Stephani <p.stephani2@gmail.com>
>  > Date: Fri, 30 Mar 2018 19:44:25 +0000
>  > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>  >
>  > Though the argument is a bit weird because `make-process' can do exactly
>  > that. It would just require changing `call-process' to use a select loop to
>  > achieve the same effect.
> 
>  Once you change call-process to do the same as make-process, what
>  would be the difference between those two?
> 
> call-process would still wait for the process to finish. 

make-process can do that, too.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-03-31  7:41       ` Eli Zaretskii
@ 2018-04-01 17:21         ` Philipp Stephani
  2018-04-01 17:29           ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2018-04-01 17:21 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 31. März 2018 um 09:41 Uhr:

> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Fri, 30 Mar 2018 21:24:00 +0000
> > Cc: help-gnu-emacs@gnu.org
> >
> > Eli Zaretskii <eliz@gnu.org> schrieb am Fr., 30. März 2018 um 23:22 Uhr:
> >
> >  > From: Philipp Stephani <p.stephani2@gmail.com>
> >  > Date: Fri, 30 Mar 2018 19:44:25 +0000
> >  > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >  >
> >  > Though the argument is a bit weird because `make-process' can do
> exactly
> >  > that. It would just require changing `call-process' to use a select
> loop to
> >  > achieve the same effect.
> >
> >  Once you change call-process to do the same as make-process, what
> >  would be the difference between those two?
> >
> > call-process would still wait for the process to finish.
>
> make-process can do that, too.
>
>
How? Probably it's some combination of make-process, process-send-region,
and accept-process-output, but I haven't yet figured out a combination that
doesn't make Emacs hang.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Query about call-process
  2018-04-01 17:21         ` Philipp Stephani
@ 2018-04-01 17:29           ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2018-04-01 17:29 UTC (permalink / raw
  To: help-gnu-emacs

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 01 Apr 2018 17:21:37 +0000
> Cc: help-gnu-emacs@gnu.org
> 
>  > call-process would still wait for the process to finish.
> 
>  make-process can do that, too.
> 
> How? Probably it's some combination of make-process, process-send-region, and accept-process-output,
> but I haven't yet figured out a combination that doesn't make Emacs hang.

Calling call-process also "hangs" Emacs until the process exits.  So
there's no difference in behavior.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-01 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-30 18:47 Query about call-process Narendra Joshi
2018-03-30 19:44 ` Philipp Stephani
2018-03-30 21:21   ` Eli Zaretskii
2018-03-30 21:24     ` Philipp Stephani
2018-03-31  7:41       ` Eli Zaretskii
2018-04-01 17:21         ` Philipp Stephani
2018-04-01 17:29           ` Eli Zaretskii

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.