From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Help with async-shell-command Date: Wed, 05 Feb 2014 02:17:07 +0100 Message-ID: <871tzis6i4.fsf@gmail.com> References: <87k3da1m04.fsf@enterprise.sectorq.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391563004 18079 80.91.229.3 (5 Feb 2014 01:16:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2014 01:16:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 05 02:16:52 2014 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 1WAr6h-0000Xn-Nq for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 02:16:51 +0100 Original-Received: from localhost ([::1]:56975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAr6h-00083f-AE for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Feb 2014 20:16:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAr6R-00083O-EP for help-gnu-emacs@gnu.org; Tue, 04 Feb 2014 20:16:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAr6L-0003Hs-F6 for help-gnu-emacs@gnu.org; Tue, 04 Feb 2014 20:16:35 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAr6L-0003Ho-82 for help-gnu-emacs@gnu.org; Tue, 04 Feb 2014 20:16:29 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WAr6K-0000N5-2O for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 02:16:28 +0100 Original-Received: from g231107136.adsl.alicedsl.de ([92.231.107.136]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Feb 2014 02:16:28 +0100 Original-Received: from tjolitz by g231107136.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Feb 2014 02:16:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231107136.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:L+4hdi18vFxDBooZX6eROp6Ta3A= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:95914 Archived-At: Pete Ley writes: > Hey, > > Is there a way to call async-shell-command so that it doesn't open an > output buffer? I'm trying to write a sync routine that'll get called > pretty often and I'd like to use async-shell-command, but it always > opens an annoying *Async Shell Command* buffer, even when there is no > output. > > So far, I've sort of solved the problem by writing a wrapper function > that calls it and (delete-windows-on "*Async Shell Command*") afterward, > but this has the side effect of closing a window I was using if the > window wasn't split for the purpose of the buffer. > > Is there a way I can 1) call a shell command asychronously 2) without > showing *Async Shell Command* and 3) without messing up my window setup? you can use ,-------------------------------------------------------------------------- | start-process is a built-in function in `C source code'. | | (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) | | Start a program in a subprocess. Return the process object for it. | NAME is name for process. It is modified if necessary to make it unique. | BUFFER is the buffer (or buffer name) to associate with the process. | | Process output (both standard output and standard error streams) goes | at end of BUFFER, unless you specify an output stream or filter | function to handle the output. BUFFER may also be nil, meaning that | this process is not associated with any buffer. `-------------------------------------------------------------------------- e.g. M-: ,-------------------------------------------------------------- | (start-process "mp" nil "mplayer" | "-playlist" "http://streams.greenhost.nl:8080/hardbop.m3u") `-------------------------------------------------------------- and then M-: ,-------------------- | (kill-process "mp") `-------------------- -- cheers, Thorsten