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: Thu, 01 Jul 2010 00:47:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Dan Nicolaescu <address@hidden> writes:

> Antoine Levitt <address@hidden> writes:
>
>> 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 &)
>
> 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.



reply via email to

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