all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Async commands in M-x compile
@ 2010-06-29 22:43 Antoine Levitt
  2010-06-30  3:20 ` Ken Raeburn
  2010-06-30  9:25 ` Thien-Thi Nguyen
  0 siblings, 2 replies; 17+ messages in thread
From: Antoine Levitt @ 2010-06-29 22:43 UTC (permalink / raw)
  To: emacs-devel

Hello,

Can someone explain to me why compile doesn't support asynchroneous
commands, and especially why it silently fails instead of displaying an
error message? I don't understand the mechanism involved here.

As a test, try M-x compile with "echo test > ~/test &" or "xclock &".

Thanks!

Antoine




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

* Re: Async commands in M-x compile
  2010-06-29 22:43 Async commands in M-x compile Antoine Levitt
@ 2010-06-30  3:20 ` Ken Raeburn
  2010-06-30  9:58   ` Antoine Levitt
  2010-06-30  9:25 ` Thien-Thi Nguyen
  1 sibling, 1 reply; 17+ messages in thread
From: Ken Raeburn @ 2010-06-30  3:20 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: emacs-devel

On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
> Hello,
> 
> Can someone explain to me why compile doesn't support asynchroneous
> commands, and especially why it silently fails instead of displaying an
> error message? I don't understand the mechanism involved here.

The program run -- the shell -- exits (after having started some other program in background).  The compilation command has finished, and exited with an exit status that indicates success.  So, you're done.  I could argue that it "succeeded", though apparently not at doing whatever it is that you think it should do.

> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".

Why would you need something like that?  Compilation mode already lets you continue doing stuff in Emacs while the compilation runs.  And you can use something like "make -j" to run multiple tasks in parallel, without losing track of the exit statuses of subprocesses, like you would with "&".

If you're not actually trying to do compilation, but just run some task in background without monitoring its progress or parsing error messages after failure, there's shell-mode, or you can give shell-command (M-!) a command ending with "&".

Ken


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

* Re: Async commands in M-x compile
  2010-06-29 22:43 Async commands in M-x compile Antoine Levitt
  2010-06-30  3:20 ` Ken Raeburn
@ 2010-06-30  9:25 ` Thien-Thi Nguyen
  2010-06-30 10:01   ` Antoine Levitt
  1 sibling, 1 reply; 17+ messages in thread
From: Thien-Thi Nguyen @ 2010-06-30  9:25 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: emacs-devel

() Antoine Levitt <antoine.levitt@gmail.com>
() Wed, 30 Jun 2010 00:43:49 +0200

   Can someone explain to me why compile doesn't support
   asynchroneous commands, and especially why it silently
   fails instead of displaying an error message? I don't
   understand the mechanism involved here.

   As a test, try M-x compile with
   "echo test > ~/test &" or "xclock &".

I think you mean to ask for "background" (job control) support.
M-x compile is already asynchronous.

If you want to the child process to not exit after it places
its own children processes in the background, you need to
tell it to ‘wait’, e.g.:

  M-x compile
  xclock & wait

Note that if you kill the *compilation* buffer, or interrupt
(via ‘C-c C-k’ aka ‘kill-compilation’) the child process,
most likely all of its children will likewise terminate.
Details depend on shell used and how that is initialized.

thi



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

* Re: Async commands in M-x compile
  2010-06-30  3:20 ` Ken Raeburn
@ 2010-06-30  9:58   ` Antoine Levitt
  2010-06-30 22:36     ` Dan Nicolaescu
  2010-06-30 23:57     ` Giorgos Keramidas
  0 siblings, 2 replies; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30  9:58 UTC (permalink / raw)
  To: Ken Raeburn; +Cc: emacs-devel

Ken Raeburn <raeburn@raeburn.org> writes:

> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>> Hello,
>> 
>> Can someone explain to me why compile doesn't support asynchroneous
>> commands, and especially why it silently fails instead of displaying an
>> error message? I don't understand the mechanism involved here.
>
> The program run -- the shell -- exits (after having started some other
> program in background).  The compilation command has finished, and
> exited with an exit status that indicates success.  So, you're done.
> I could argue that it "succeeded", though apparently not at doing
> whatever it is that you think it should do.

Yes, I would completely agree with that, except it _doesn't_ start the
program. Try running "xclock &"

>
>> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".
>
> Why would you need something like that?  Compilation mode already lets
> you continue doing stuff in Emacs while the compilation runs.  And you
> can use something like "make -j" to run multiple tasks in parallel,
> without losing track of the exit statuses of subprocesses, like you
> would with "&".
>
> If you're not actually trying to do compilation, but just run some
> task in background without monitoring its progress or parsing error
> messages after failure, there's shell-mode, or you can give
> shell-command (M-!) a command ending with "&".

Well, to be fair, I'm actually using compilation for another purpose
than what it was built for. I want to perform the action "compile latex,
if there is already a viewer, bring it to the front, if not, run one",
ie,

rubber -d main && (wmctrl -a main.pdf || gnome-open main.pdf &)

But the last bit does not work, ie it doesn't run the viewer, the same
as when I do "xclock &", which just silently returns success without
starting the program, and I don't understand this behaviour.

>
> Ken



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

* Re: Async commands in M-x compile
  2010-06-30  9:25 ` Thien-Thi Nguyen
@ 2010-06-30 10:01   ` Antoine Levitt
  2010-06-30 19:14     ` Thien-Thi Nguyen
  0 siblings, 1 reply; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30 10:01 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: emacs-devel

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> () Antoine Levitt <antoine.levitt@gmail.com>
> () Wed, 30 Jun 2010 00:43:49 +0200
>
>    Can someone explain to me why compile doesn't support
>    asynchroneous commands, and especially why it silently
>    fails instead of displaying an error message? I don't
>    understand the mechanism involved here.
>
>    As a test, try M-x compile with
>    "echo test > ~/test &" or "xclock &".
>
> I think you mean to ask for "background" (job control) support.
> M-x compile is already asynchronous.
>
> If you want to the child process to not exit after it places
> its own children processes in the background, you need to
> tell it to ‘wait’, e.g.:
>
>   M-x compile
>   xclock & wait
>
> Note that if you kill the *compilation* buffer, or interrupt
> (via ‘C-c C-k’ aka ‘kill-compilation’) the child process,
> most likely all of its children will likewise terminate.
> Details depend on shell used and how that is initialized.
>
> thi

I should have been clearer. I really want to start a background job,
but the job doesn't start: when I do xclock &, it just returns without
starting xclock. "xclock & wait" works fine (so does "xclock" for that
matter), but the point is I don't want to wait for the process to
finish.



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

* Re: Async commands in M-x compile
  2010-06-30 10:01   ` Antoine Levitt
@ 2010-06-30 19:14     ` Thien-Thi Nguyen
  2010-06-30 19:30       ` Antoine Levitt
  0 siblings, 1 reply; 17+ messages in thread
From: Thien-Thi Nguyen @ 2010-06-30 19:14 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: emacs-devel

() Antoine Levitt <antoine.levitt@gmail.com>
() Wed, 30 Jun 2010 12:01:27 +0200

   the point is I don't want to wait for the process to finish.

In this case, try ‘M-x shell-command RET xclock & RET’.
Note ampersand.

thi



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

* Re: Async commands in M-x compile
  2010-06-30 19:14     ` Thien-Thi Nguyen
@ 2010-06-30 19:30       ` Antoine Levitt
  2010-06-30 21:20         ` Thien-Thi Nguyen
  2010-06-30 21:51         ` Andreas Schwab
  0 siblings, 2 replies; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30 19:30 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: emacs-devel

Yes, I understand that. What I don't understand is why this command does
not work when using compile.
Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> () Antoine Levitt <antoine.levitt@gmail.com>
> () Wed, 30 Jun 2010 12:01:27 +0200
>
>    the point is I don't want to wait for the process to finish.
>
> In this case, try ‘M-x shell-command RET xclock & RET’.
> Note ampersand.
>
> thi



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

* Re: Async commands in M-x compile
  2010-06-30 19:30       ` Antoine Levitt
@ 2010-06-30 21:20         ` Thien-Thi Nguyen
  2010-06-30 21:51         ` Andreas Schwab
  1 sibling, 0 replies; 17+ messages in thread
From: Thien-Thi Nguyen @ 2010-06-30 21:20 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: emacs-devel

() Antoine Levitt <antoine.levitt@gmail.com>
() Wed, 30 Jun 2010 21:30:54 +0200

   Yes, I understand that.
   What I don't understand is why this command does
   not work when using compile.

The two commands are different.  If you expect them to behave
the same, then you need to adjust your expectations.  That may
not help you to understand, but it will make your search for
an explanation easier.  Good luck!

thi



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

* Re: Async commands in M-x compile
  2010-06-30 19:30       ` Antoine Levitt
  2010-06-30 21:20         ` Thien-Thi Nguyen
@ 2010-06-30 21:51         ` Andreas Schwab
  2010-06-30 22:23           ` Antoine Levitt
  2010-07-01  1:30           ` Stefan Monnier
  1 sibling, 2 replies; 17+ messages in thread
From: Andreas Schwab @ 2010-06-30 21:51 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: Thien-Thi Nguyen, emacs-devel

Antoine Levitt <antoine.levitt@gmail.com> writes:

> Yes, I understand that. What I don't understand is why this command does
> not work when using compile.

It does work, but the command is immediately killed by SIGHUP because
the session is closed.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Async commands in M-x compile
  2010-06-30 21:51         ` Andreas Schwab
@ 2010-06-30 22:23           ` Antoine Levitt
  2010-07-01  1:30           ` Stefan Monnier
  1 sibling, 0 replies; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30 22:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thien-Thi Nguyen, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

Ah, thanks, that's it! Using nohup did the trick. Now my one-line solution
to all things latexy is

rubber -d main && (wmctrl -a main.pdf || nohup gnome-open main.pdf >
/dev/null)

which compiles the document and runs a viewer.

Thanks!
Antoine
On 30 June 2010 23:51, Andreas Schwab <schwab@linux-m68k.org> wrote:

> Antoine Levitt <antoine.levitt@gmail.com> writes:
>
> > Yes, I understand that. What I don't understand is why this command does
> > not work when using compile.
>
> It does work, but the command is immediately killed by SIGHUP because
> the session is closed.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>

[-- Attachment #2: Type: text/html, Size: 1299 bytes --]

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

* Re: Async commands in M-x compile
  2010-06-30  9:58   ` Antoine Levitt
@ 2010-06-30 22:36     ` Dan Nicolaescu
  2010-06-30 22:47       ` Antoine Levitt
  2010-06-30 23:57     ` Giorgos Keramidas
  1 sibling, 1 reply; 17+ messages in thread
From: Dan Nicolaescu @ 2010-06-30 22:36 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: Ken Raeburn, emacs-devel

Antoine Levitt <antoine.levitt@gmail.com> writes:

> Ken Raeburn <raeburn@raeburn.org> writes:
>
>> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>>> Hello,
>>> 
>>> Can someone explain to me why compile doesn't support asynchroneous
>>> commands, and especially why it silently fails instead of displaying an
>>> error message? I don't understand the mechanism involved here.
>>
>> The program run -- the shell -- exits (after having started some other
>> program in background).  The compilation command has finished, and
>> exited with an exit status that indicates success.  So, you're done.
>> I could argue that it "succeeded", though apparently not at doing
>> whatever it is that you think it should do.
>
> Yes, I would completely agree with that, except it _doesn't_ start the
> program. Try running "xclock &"
>
>>
>>> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".
>>
>> Why would you need something like that?  Compilation mode already lets
>> you continue doing stuff in Emacs while the compilation runs.  And you
>> can use something like "make -j" to run multiple tasks in parallel,
>> without losing track of the exit statuses of subprocesses, like you
>> would with "&".
>>
>> If you're not actually trying to do compilation, but just run some
>> task in background without monitoring its progress or parsing error
>> messages after failure, there's shell-mode, or you can give
>> shell-command (M-!) a command ending with "&".
>
> Well, to be fair, I'm actually using compilation for another purpose
> than what it was built for. I want to perform the action "compile latex,
> if there is already a viewer, bring it to the front, if not, run one",
> ie,
>
> rubber -d main && (wmctrl -a main.pdf || gnome-open main.pdf &)

Have you tried AUCTeX?  It should be able to do this by default ...
Alternatively, you can use the infrastructure in tex.el to accomplish
what you want.



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

* Re: Async commands in M-x compile
  2010-06-30 22:36     ` Dan Nicolaescu
@ 2010-06-30 22:47       ` Antoine Levitt
  2010-06-30 22:54         ` Dan Nicolaescu
  0 siblings, 1 reply; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30 22:47 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Ken Raeburn, emacs-devel

Dan Nicolaescu <dann@gnu.org> writes:

> Antoine Levitt <antoine.levitt@gmail.com> writes:
>
>> Ken Raeburn <raeburn@raeburn.org> writes:
>>
>>> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>>>> Hello,
>>>> 
>>>> Can someone explain to me why compile doesn't support asynchroneous
>>>> commands, and especially why it silently fails instead of displaying an
>>>> error message? I don't understand the mechanism involved here.
>>>
>>> The program run -- the shell -- exits (after having started some other
>>> program in background).  The compilation command has finished, and
>>> exited with an exit status that indicates success.  So, you're done.
>>> I could argue that it "succeeded", though apparently not at doing
>>> whatever it is that you think it should do.
>>
>> Yes, I would completely agree with that, except it _doesn't_ start the
>> program. Try running "xclock &"
>>
>>>
>>>> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".
>>>
>>> Why would you need something like that?  Compilation mode already lets
>>> you continue doing stuff in Emacs while the compilation runs.  And you
>>> can use something like "make -j" to run multiple tasks in parallel,
>>> without losing track of the exit statuses of subprocesses, like you
>>> would with "&".
>>>
>>> If you're not actually trying to do compilation, but just run some
>>> task in background without monitoring its progress or parsing error
>>> messages after failure, there's shell-mode, or you can give
>>> shell-command (M-!) a command ending with "&".
>>
>> Well, to be fair, I'm actually using compilation for another purpose
>> than what it was built for. I want to perform the action "compile latex,
>> if there is already a viewer, bring it to the front, if not, run one",
>> ie,
>>
>> rubber -d main && (wmctrl -a main.pdf || gnome-open main.pdf &)
>
> Have you tried AUCTeX?  It should be able to do this by default ...
> Alternatively, you can use the infrastructure in tex.el to accomplish
> what you want.

I used to use AUCTeX, but there is a number of things it doesn't do (at
least, not without extensive coding, which I'm not prepared to
do). Rubber checks for dependencies (including \input and
\includegraphics), runs bibtex, and runs the right amount of times, all
in one run. It also produces clean error output, which is something that
has bugged me with AUCTeX. It's true that AUCTeX is able to run viewers
etc, but I'm looking for a one-command solution, which I achieved with
this shell line.



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

* Re: Async commands in M-x compile
  2010-06-30 22:47       ` Antoine Levitt
@ 2010-06-30 22:54         ` Dan Nicolaescu
  2010-06-30 23:02           ` Antoine Levitt
  0 siblings, 1 reply; 17+ messages in thread
From: Dan Nicolaescu @ 2010-06-30 22:54 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: Ken Raeburn, emacs-devel

Antoine Levitt <antoine.levitt@gmail.com> writes:

> Dan Nicolaescu <dann@gnu.org> writes:
>
>> Antoine Levitt <antoine.levitt@gmail.com> writes:
>>
>>> Ken Raeburn <raeburn@raeburn.org> writes:
>>>
>>>> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>>>>> Hello,
>>>>> 
>>>>> Can someone explain to me why compile doesn't support asynchroneous
>>>>> commands, and especially why it silently fails instead of displaying an
>>>>> error message? I don't understand the mechanism involved here.
>>>>
>>>> The program run -- the shell -- exits (after having started some other
>>>> program in background).  The compilation command has finished, and
>>>> exited with an exit status that indicates success.  So, you're done.
>>>> I could argue that it "succeeded", though apparently not at doing
>>>> whatever it is that you think it should do.
>>>
>>> Yes, I would completely agree with that, except it _doesn't_ start the
>>> program. Try running "xclock &"
>>>
>>>>
>>>>> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".
>>>>
>>>> Why would you need something like that?  Compilation mode already lets
>>>> you continue doing stuff in Emacs while the compilation runs.  And you
>>>> can use something like "make -j" to run multiple tasks in parallel,
>>>> without losing track of the exit statuses of subprocesses, like you
>>>> would with "&".
>>>>
>>>> If you're not actually trying to do compilation, but just run some
>>>> task in background without monitoring its progress or parsing error
>>>> messages after failure, there's shell-mode, or you can give
>>>> shell-command (M-!) a command ending with "&".
>>>
>>> Well, to be fair, I'm actually using compilation for another purpose
>>> than what it was built for. I want to perform the action "compile latex,
>>> if there is already a viewer, bring it to the front, if not, run one",
>>> ie,
>>>
>>> rubber -d main && (wmctrl -a main.pdf || gnome-open main.pdf &)
>>
>> Have you tried AUCTeX?  It should be able to do this by default ...
>> Alternatively, you can use the infrastructure in tex.el to accomplish
>> what you want.
>
> I used to use AUCTeX, but there is a number of things it doesn't do (at
> least, not without extensive coding, which I'm not prepared to
> do). 

Ask the AUCTeX list, using your preferred command should be one or two
lines of code, or just customization.

> Rubber checks for dependencies (including \input and
> \includegraphics), runs bibtex, and runs the right amount of times, all
> in one run. It also produces clean error output, which is something that
> has bugged me with AUCTeX. It's true that AUCTeX is able to run viewers
> etc, but I'm looking for a one-command solution, which I achieved with
> this shell line.

Then just run that command using one of the methods that were shown in
this thread.



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

* Re: Async commands in M-x compile
  2010-06-30 22:54         ` Dan Nicolaescu
@ 2010-06-30 23:02           ` Antoine Levitt
  0 siblings, 0 replies; 17+ messages in thread
From: Antoine Levitt @ 2010-06-30 23:02 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Ken Raeburn, emacs-devel

Dan Nicolaescu <dann@gnu.org> writes:

> Antoine Levitt <antoine.levitt@gmail.com> writes:
>
>> Dan Nicolaescu <dann@gnu.org> writes:
>>
>>> Antoine Levitt <antoine.levitt@gmail.com> writes:
>>>
>>>> Ken Raeburn <raeburn@raeburn.org> writes:
>>>>
>>>>> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>>>>>> Hello,
>>>>>> 
>>>>>> Can someone explain to me why compile doesn't support asynchroneous
>>>>>> commands, and especially why it silently fails instead of displaying an
>>>>>> error message? I don't understand the mechanism involved here.
>>>>>
>>>>> The program run -- the shell -- exits (after having started some other
>>>>> program in background).  The compilation command has finished, and
>>>>> exited with an exit status that indicates success.  So, you're done.
>>>>> I could argue that it "succeeded", though apparently not at doing
>>>>> whatever it is that you think it should do.
>>>>
>>>> Yes, I would completely agree with that, except it _doesn't_ start the
>>>> program. Try running "xclock &"
>>>>
>>>>>
>>>>>> As a test, try M-x compile with "echo test > ~/test &" or "xclock &".
>>>>>
>>>>> Why would you need something like that?  Compilation mode already lets
>>>>> you continue doing stuff in Emacs while the compilation runs.  And you
>>>>> can use something like "make -j" to run multiple tasks in parallel,
>>>>> without losing track of the exit statuses of subprocesses, like you
>>>>> would with "&".
>>>>>
>>>>> If you're not actually trying to do compilation, but just run some
>>>>> task in background without monitoring its progress or parsing error
>>>>> messages after failure, there's shell-mode, or you can give
>>>>> shell-command (M-!) a command ending with "&".
>>>>
>>>> Well, to be fair, I'm actually using compilation for another purpose
>>>> than what it was built for. I want to perform the action "compile latex,
>>>> if there is already a viewer, bring it to the front, if not, run one",
>>>> ie,
>>>>
>>>> rubber -d main && (wmctrl -a main.pdf || gnome-open main.pdf &)
>>>
>>> Have you tried AUCTeX?  It should be able to do this by default ...
>>> Alternatively, you can use the infrastructure in tex.el to accomplish
>>> what you want.
>>
>> I used to use AUCTeX, but there is a number of things it doesn't do (at
>> least, not without extensive coding, which I'm not prepared to
>> do). 
>
> Ask the AUCTeX list, using your preferred command should be one or two
> lines of code, or just customization.

Yes, except I'd have to adjust the output to check for errors in a
format auctex expects, etc. I'm very happy with compilation, thank you
very much. Using auctex would be of no benefit here.

>
>> Rubber checks for dependencies (including \input and
>> \includegraphics), runs bibtex, and runs the right amount of times, all
>> in one run. It also produces clean error output, which is something that
>> has bugged me with AUCTeX. It's true that AUCTeX is able to run viewers
>> etc, but I'm looking for a one-command solution, which I achieved with
>> this shell line.
>
> Then just run that command using one of the methods that were shown in
> this thread.



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

* Re: Async commands in M-x compile
  2010-06-30  9:58   ` Antoine Levitt
  2010-06-30 22:36     ` Dan Nicolaescu
@ 2010-06-30 23:57     ` Giorgos Keramidas
  1 sibling, 0 replies; 17+ messages in thread
From: Giorgos Keramidas @ 2010-06-30 23:57 UTC (permalink / raw)
  To: Antoine Levitt; +Cc: Ken Raeburn, emacs-devel

On Wed, 30 Jun 2010 11:58:06 +0200, Antoine Levitt <antoine.levitt@gmail.com> wrote:
> Ken Raeburn <raeburn@raeburn.org> writes:
>
>> On Jun 29, 2010, at 18:43, Antoine Levitt wrote:
>>> Hello,
>>> 
>>> Can someone explain to me why compile doesn't support asynchroneous
>>> commands, and especially why it silently fails instead of displaying an
>>> error message? I don't understand the mechanism involved here.
>>
>> The program run -- the shell -- exits (after having started some other
>> program in background).  The compilation command has finished, and
>> exited with an exit status that indicates success.  So, you're done.
>> I could argue that it "succeeded", though apparently not at doing
>> whatever it is that you think it should do.
>
> Yes, I would completely agree with that, except it _doesn't_ start the
> program. Try running "xclock &"

It may be starting the program and killing it too fast, e.g. because the
parent shell reaps its child processes before it exits.  Can you try
running a "nohup sh foo.sh" script that spawns the echo redirection to
see if this is indeed the case?




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

* Re: Async commands in M-x compile
  2010-06-30 21:51         ` Andreas Schwab
  2010-06-30 22:23           ` Antoine Levitt
@ 2010-07-01  1:30           ` Stefan Monnier
  2010-07-01  7:46             ` Jan Djärv
  1 sibling, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2010-07-01  1:30 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel, Thien-Thi Nguyen, Antoine Levitt

>> Yes, I understand that. What I don't understand is why this command does
>> not work when using compile.
> It does work, but the command is immediately killed by SIGHUP because
> the session is closed.

Indeed.  Maybe we should try and change that (if it's even possible).


        Stefan



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

* Re: Async commands in M-x compile
  2010-07-01  1:30           ` Stefan Monnier
@ 2010-07-01  7:46             ` Jan Djärv
  0 siblings, 0 replies; 17+ messages in thread
From: Jan Djärv @ 2010-07-01  7:46 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Antoine Levitt, Andreas Schwab, Thien-Thi Nguyen, emacs-devel



Stefan Monnier skrev 2010-07-01 03.30:
>>> Yes, I understand that. What I don't understand is why this command does
>>> not work when using compile.
>> It does work, but the command is immediately killed by SIGHUP because
>> the session is closed.
>
> Indeed.  Maybe we should try and change that (if it's even possible).
>

But you want SIGHUP to children if for example Emacs dies.  To change this is 
too complex.  Bash and ksh has disown to "nohup" children, but it is not portable.

	Jan D.



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

end of thread, other threads:[~2010-07-01  7:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 22:43 Async commands in M-x compile Antoine Levitt
2010-06-30  3:20 ` Ken Raeburn
2010-06-30  9:58   ` Antoine Levitt
2010-06-30 22:36     ` Dan Nicolaescu
2010-06-30 22:47       ` Antoine Levitt
2010-06-30 22:54         ` Dan Nicolaescu
2010-06-30 23:02           ` Antoine Levitt
2010-06-30 23:57     ` Giorgos Keramidas
2010-06-30  9:25 ` Thien-Thi Nguyen
2010-06-30 10:01   ` Antoine Levitt
2010-06-30 19:14     ` Thien-Thi Nguyen
2010-06-30 19:30       ` Antoine Levitt
2010-06-30 21:20         ` Thien-Thi Nguyen
2010-06-30 21:51         ` Andreas Schwab
2010-06-30 22:23           ` Antoine Levitt
2010-07-01  1:30           ` Stefan Monnier
2010-07-01  7:46             ` Jan Djärv

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.