help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with async-shell-command


From: Thorsten Jolitz
Subject: Re: Help with async-shell-command
Date: Wed, 05 Feb 2014 02:17:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Pete Ley <peteley11235@gmail.com> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]