From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Hofert Newsgroups: gmane.emacs.help Subject: Re: How to suppress/avoid *Async Shell Command* buffer? Date: Sat, 18 May 2013 23:19:33 +0200 Message-ID: <87d2sox9y2.fsf@math.ethz.ch> References: <5197784A.1020500@easy-emacs.de> <87sj1ktmnq.fsf@math.ethz.ch> <5197913E.1010702@easy-emacs.de> <87mwrstku1.fsf@math.ethz.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1368912003 19383 80.91.229.3 (18 May 2013 21:20:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 May 2013 21:20:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Barry Margolin" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 18 23:20:01 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UdoXo-000749-Ah for geh-help-gnu-emacs@m.gmane.org; Sat, 18 May 2013 23:20:00 +0200 Original-Received: from localhost ([::1]:52166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdoXn-0001RA-QS for geh-help-gnu-emacs@m.gmane.org; Sat, 18 May 2013 17:19:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdoXY-0001R5-UR for help-gnu-emacs@gnu.org; Sat, 18 May 2013 17:19:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdoXS-0006Ui-LF for help-gnu-emacs@gnu.org; Sat, 18 May 2013 17:19:44 -0400 Original-Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:52696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdoXS-0006UU-EK for help-gnu-emacs@gnu.org; Sat, 18 May 2013 17:19:38 -0400 Original-Received: by mail-wg0-f46.google.com with SMTP id l18so134815wgh.1 for ; Sat, 18 May 2013 14:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:user-agent :in-reply-to:date:message-id:mime-version:content-type :content-transfer-encoding; bh=+QwswEGLDxAv1hK/vsCJfP8oadJ3ufn91kZkUIBdwpQ=; b=EpsLyNP0uERloXE+//TIrZ4Tv4hzEec1dY1GBsIy+zn/q90pPZag/p2fK8Yge6WUul cWkjTs+z99BCoT9+ct+RW9vSJ2+BiPE5Rl0LBJGL/hJ/kAHE4+pluW2ijOJeYDbBLfPP hxx/7cPh6OgbnbkfIG0yig8qjk5xF9mHJKyj8/XsHrx7MazMtAOIxs93S37eum5IB74G 1UlMNxBP8E8ntPvMcrniztLOjMopE8osIR+Kn6irJnOCQ1goR+pEGmb67mms+Phsu/hS KHE3rTarS7KXqdw6pvySw4EcpjNpNctcWu7SyoC8tkTC7A7XhDY6SQ1IVjaXOINOMoXl 4zaQ== X-Received: by 10.194.86.100 with SMTP id o4mr6983193wjz.5.1368911977757; Sat, 18 May 2013 14:19:37 -0700 (PDT) Original-Received: from sklar (178-83-94-113.dynamic.hispeed.ch. [178.83.94.113]) by mx.google.com with ESMTPSA id m3sm5039336wij.5.2013.05.18.14.19.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 18 May 2013 14:19:36 -0700 (PDT) User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90913 Archived-At: Barry Margolin writes: > In article , > Andreas Röhler wrote: > >> Am 18.05.2013 16:37, schrieb Marius Hofert: >> > Hi Andreas, >> > >> > what do you mean by 'caused'? >> > >> > The question mark is a place holder for the file (foo.pdf). >> >> Okay, see dired-do-shell-command reads it >> >> > What does this have to do with *Async Shell Command* being opened? >> > >> >> Nothing. It's the ampersand following ? which matters. >> >> > Note: The behavior of "!" on foo.pdf in dired mode is fine (in the sense >> > that Okular opens, the pdf is shown, everything asynchronously), I just want >> > to avoid the buffer *Async Shell Command* being opened. >> > >> >> Which seems the buffer Emacs connects the process to. >> Deleting it should end the processes, probably not a good idea. >> >> So the ampersand seems the culprit - not the question mark. >> What happens when calling your stuff without it? > > This is essentially the same as using M-!, isn't it, except that it > automatically fills in the filename argument? If you don't use the > ampersand, Emacs waits for the command to finish, and then displays the > output in *Shell Command Output*. If you use ampersand, it doesn't wait, > and displays the output incrementally in *Async Shell Command*. > > Either way, the output has to be put somewhere. > > However, the synchronous mode has a feature: if the command produces > little or no output, it doesn't switch to the *Shell Command Output* > buffer, it just displays it in the minibuffer. Here's a trick that I > think should do what you want: Run the backgrounded command in a > subshell (wrap it in parentheses): > > ! (command ? &>/dev/null &) indeed, this also works, very nice! Thanks, Barry. Cheers, Marius > > > As far as Emacs is concerned, that's a synchronous command, because it > doesn't end in "&". But it runs in the background within the subshell. > Redirect the output so that Emacs immediately reads EOF, and has nothing > to display in the minibuffer (it may display "(Shell command completed > with no output)").