emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Async commands in M-x compile


From: Antoine Levitt
Subject: Re: Async commands in M-x compile
Date: Wed, 30 Jun 2010 11:58:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Ken Raeburn <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]