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 00:47:58 +0200 Message-ID: <87r5jorvc1.fsf@gmail.com> References: <87d3v9mpcq.fsf@gmail.com> <87k4pgkfkh.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 16569 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 1OU9z4-0006CN-IY for ged-emacs-devel@m.gmane.org; Thu, 01 Jul 2010 04:58:38 +0200 Original-Received: from localhost ([127.0.0.1]:38183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU9z3-0006Ey-TU for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 22:58:37 -0400 Original-Received: from [140.186.70.92] (port=41558 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU64b-0001la-UM for emacs-devel@gnu.org; Wed, 30 Jun 2010 18:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OU64a-0002iK-Du for emacs-devel@gnu.org; Wed, 30 Jun 2010 18:48:05 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:43325) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OU64a-0002i8-9q; Wed, 30 Jun 2010 18:48:04 -0400 Original-Received: by wyb39 with SMTP id 39so1475221wyb.0 for ; Wed, 30 Jun 2010 15:48:03 -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:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=GoDBF7eY6maH2VcLQXyAul66zIrv/bHiFAcvB9eB+1Q=; b=Fa7iCdHutntBuMH/gYkgzi5qmOfhk5AdMwI3InnnXKH1gs9YnddYr7Gq8x9eQxJJFK YiiktXtD6K6x/+5aTNK6/LOEExZPoev2SsZIFmVBA6XYzQTV5h7CiiMpLarYrNnqmZRh 4jUZiJbVHh1BZRFd7SxdesQb8FH42uku+eLsM= 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=T+BgLuqOOZrj7GkqOVrYC3IIwd3UXLweQMjAGKRmmdhIn1GFjBtBj/wdXuKmtgqW+c pv94nkqlY2wLB4fc7fW1C4LpMM+LdNR6tmGEmqYEv0ytL09rLKsU+M3/0SAYtZ0qQ1Ym vPjguWXLi2o3w1kU5OLq+KrPC5f1CHq5h5Zlg= Original-Received: by 10.216.160.15 with SMTP id t15mr7623431wek.17.1277938083066; Wed, 30 Jun 2010 15:48:03 -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 l46sm11540314wed.10.2010.06.30.15.48.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Jun 2010 15:48:02 -0700 (PDT) In-Reply-To: (Dan Nicolaescu's message of "Wed, 30 Jun 2010 18:36:56 -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:126580 Archived-At: 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). 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.