From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: Async commands in M-x compile Date: Thu, 01 Jul 2010 01:02:04 +0200 Message-ID: <87hbkkruoj.fsf@gmail.com> 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 1277953124 16568 80.91.229.12 (1 Jul 2010 02:58:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Jul 2010 02:58:44 +0000 (UTC) Cc: , Ken Raeburn , emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 01 04:58:40 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 1OU9z6-0006Cs-6u for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 04:58:40 +0200 Original-Received: from localhost ([127.0.0.1]:38201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU9z5-0006Fc-KD for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 22:58:39 -0400 Original-Received: from [140.186.70.92] (port=40886 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU6ID-00070g-Iu for emacs-devel@gnu.org; Wed, 30 Jun 2010 19:02:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OU6IB-0004ao-Vj for emacs-devel@gnu.org; Wed, 30 Jun 2010 19:02:09 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:47399) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OU6IB-0004aj-QF; Wed, 30 Jun 2010 19:02:07 -0400 Original-Received: by wyb39 with SMTP id 39so1482829wyb.0 for ; Wed, 30 Jun 2010 16:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:cc:subject :references:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=EM2pCPmvJJFzzXUYXvn3Mrw3yk15OS9bEH8ob/rXSmI=; b=ewKUTfVwUtbq9LeaQ49GWqgKKfi6pu/8iK9DELtPrnG22lB+Edp/JecCGOwa2n7DMn izhzqM1i0FvfiK6voV18mr5uP0tSxYT2nDrEcymczfvVpskrgOE9PwVoKS79YqVGqz47 8DCj/jtTaQU+7nnlPG3CA12689LFF0P1f+ptc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=vlHcXShjDeMLZaLfmTOGIMwZOyp+fg45YtIkMdofwgSaBdzf3WyJ2U0HFjMWfjOJY/ F2KFHJdiKnNmtNTUHpQpl7AUUrdXi5+5X7nR4SGcdQf2SIw6H08yj0itXnq6s3gg6izD ZoSeryOsxRiwHVO7SpbQDCXQ2a0ycPtwsfdaE= Original-Received: by 10.216.161.133 with SMTP id w5mr114128wek.47.1277938926745; Wed, 30 Jun 2010 16:02:06 -0700 (PDT) Original-Received: from lambda (uni14-1-82-233-220-106.fbx.proxad.net [82.233.220.106]) by mx.google.com with ESMTPS id o3sm9341569wee.14.2010.06.30.16.02.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Jun 2010 16:02:06 -0700 (PDT) In-Reply-To: (Dan Nicolaescu's message of "Wed, 30 Jun 2010 18:54:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 30 Jun 2010 22:58:30 -0400 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:126579 Archived-At: Dan Nicolaescu writes: > 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. 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.