From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: Async commands in M-x compile Date: Wed, 30 Jun 2010 18:54:47 -0400 Message-ID: References: <87d3v9mpcq.fsf@gmail.com> <87k4pgkfkh.fsf@gmail.com> <87r5jorvc1.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1277938497 15786 80.91.229.12 (30 Jun 2010 22:54:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2010 22:54:57 +0000 (UTC) Cc: Ken Raeburn , emacs-devel@gnu.org To: Antoine Levitt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 01 00:54:56 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OU6BD-0000yt-C2 for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 00:54:55 +0200 Original-Received: from localhost ([127.0.0.1]:55528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU6BC-0004Zg-Ky for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 18:54:54 -0400 Original-Received: from [199.232.76.173] (port=34624 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU6B7-0004Yp-E5 for emacs-devel@gnu.org; Wed, 30 Jun 2010 18:54:49 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1OU6B5-0000Hd-TN for emacs-devel@gnu.org; Wed, 30 Jun 2010 18:54:49 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:53137) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1OU6B5-0000HY-JU for emacs-devel@gnu.org; Wed, 30 Jun 2010 18:54:47 -0400 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OU6B5-00028Z-5y; Wed, 30 Jun 2010 18:54:47 -0400 In-Reply-To: <87r5jorvc1.fsf@gmail.com> (Antoine Levitt's message of "Thu\, 01 Jul 2010 00\:47\:58 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126561 Archived-At: Antoine Levitt writes: > Dan Nicolaescu writes: > >> Antoine Levitt writes: >> >>> Ken Raeburn 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.