all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Asynchronous commands with eshell-command
@ 2009-01-26 19:39 Michael Heerdegen
  2009-01-27 16:09 ` Sebastian Tennant
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Heerdegen @ 2009-01-26 19:39 UTC (permalink / raw)
  To: help-gnu-emacs

Does anybody know how to start external commands asynchronously with
`eshell-command'? I tried `xterm &' for example, which works but also
raises an error.

The source code seems to support the asynchronous case, but I don't
know what to type.

Thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Asynchronous commands with eshell-command
@ 2009-01-27 11:49 Nurullah Akkaya
  0 siblings, 0 replies; 6+ messages in thread
From: Nurullah Akkaya @ 2009-01-27 11:49 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

Hi,

a while ago i hacked SudoSave to run a process as root asynchronously to run
nmap within emacs.
you can grab a copy here http://nakkaya.com/sudoEl.html
i am a new to lisp it may not be the best way to do it but it works.

regards,
Nurullah

[-- Attachment #2: Type: text/html, Size: 318 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Asynchronous commands with eshell-command
  2009-01-26 19:39 Asynchronous commands with eshell-command Michael Heerdegen
@ 2009-01-27 16:09 ` Sebastian Tennant
  2009-01-27 16:40   ` Thierry Volpiatto
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Tennant @ 2009-01-27 16:09 UTC (permalink / raw)
  To: help-gnu-emacs

Quoth Michael Heerdegen <michaelh@minet.uni-jena.de>:
> Does anybody know how to start external commands asynchronously with
> `eshell-command'? I tried `xterm &' for example, which works but also
> raises an error.
>
> The source code seems to support the asynchronous case, but I don't
> know what to type.

Where's Thierry Volpiatto when you need him :)

Sebastian
-- 
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Asynchronous commands with eshell-command
  2009-01-27 16:09 ` Sebastian Tennant
@ 2009-01-27 16:40   ` Thierry Volpiatto
  2009-01-27 18:55     ` Sebastian Tennant
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2009-01-27 16:40 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Michael, Sebastian and all!
Sebastian Tennant <sebyte@smolny.plus.com> writes:

> Quoth Michael Heerdegen <michaelh@minet.uni-jena.de>:
>> Does anybody know how to start external commands asynchronously with
>> `eshell-command'? I tried `xterm &' for example, which works but also
>> raises an error.
>>
>> The source code seems to support the asynchronous case, but I don't
>> know what to type.
>
> Where's Thierry Volpiatto when you need him :)

I am here again!
But i am not a specialist of eshell, just a user that use always
eshell-command instead of shell-command (M-!) because it's much more
powerful:
It accept elisp code, shell code, the both mixed, alias, all completion
and more.

But for asynchronous commands, i don't know.
Using & work fine here, except apply seem to doesn't like the &.
May be have a look at `eshell-parse-argument-hook'.
I will look at that on my side.

But if you want to make more complex async commands, why not creating a
specialized function using start-process/start-process-shell-command
with another sentinel-function that use set-process-sentinel ?

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Asynchronous commands with eshell-command
  2009-01-27 16:40   ` Thierry Volpiatto
@ 2009-01-27 18:55     ` Sebastian Tennant
  2009-01-27 19:51       ` Thierry Volpiatto
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Tennant @ 2009-01-27 18:55 UTC (permalink / raw)
  To: help-gnu-emacs

Quoth Thierry Volpiatto <thierry.volpiatto@gmail.com>:
> Sebastian Tennant <sebyte@smolny.plus.com> writes:
>
>> Quoth Michael Heerdegen <michaelh@minet.uni-jena.de>:
>>> Does anybody know how to start external commands asynchronously with
>>> `eshell-command'? I tried `xterm &' for example, which works but also
>>> raises an error.
>>>
>>> The source code seems to support the asynchronous case, but I don't
>>> know what to type.
>>
>> Where's Thierry Volpiatto when you need him :)
>
> I am here again!

Great :)

> But i am not a specialist of eshell, just a user that use always
> eshell-command instead of shell-command (M-!) because it's much more
> powerful: It accept elisp code, shell code, the both mixed, alias, all
> completion and more.

The fact it is so powerful is what puts me off.  I can sees days, and
even weeks, disappearing as I get more and more into it :)

> But if you want to make more complex async commands, why not creating
> a specialized function using start-process/start-process-shell-command
> with another sentinel-function that use set-process-sentinel ?

Hmm... like interactive-asynchronous-shell-command? :)

 http://article.gmane.org/gmane.emacs.sources/3147

I suspect Michael knows all about these kinds of methods and is being a
little braver than I am in starting to explore the capabilities of
eshell.

Seb
-- 
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Asynchronous commands with eshell-command
  2009-01-27 18:55     ` Sebastian Tennant
@ 2009-01-27 19:51       ` Thierry Volpiatto
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Volpiatto @ 2009-01-27 19:51 UTC (permalink / raw)
  To: help-gnu-emacs

Sebastian Tennant <sebyte@smolny.plus.com> writes:

> Quoth Thierry Volpiatto <thierry.volpiatto@gmail.com>:
>> Sebastian Tennant <sebyte@smolny.plus.com> writes:
>>
>>> Quoth Michael Heerdegen <michaelh@minet.uni-jena.de>:
>>>> Does anybody know how to start external commands asynchronously with
>>>> `eshell-command'? I tried `xterm &' for example, which works but also
>>>> raises an error.
>>>>
>>>> The source code seems to support the asynchronous case, but I don't
>>>> know what to type.
>>>
>>> Where's Thierry Volpiatto when you need him :)
>>
>> I am here again!
>
> Great :)
>
>> But i am not a specialist of eshell, just a user that use always
>> eshell-command instead of shell-command (M-!) because it's much more
>> powerful: It accept elisp code, shell code, the both mixed, alias, all
>> completion and more.
>
> The fact it is so powerful is what puts me off.  I can sees days, and
> even weeks, disappearing as I get more and more into it :)
>
>> But if you want to make more complex async commands, why not creating
>> a specialized function using start-process/start-process-shell-command
>> with another sentinel-function that use set-process-sentinel ?
>
> Hmm... like interactive-asynchronous-shell-command? :)

Yes i saw you wrote something about async shell-command ;)
I will have a look.

>  http://article.gmane.org/gmane.emacs.sources/3147
>
> I suspect Michael knows all about these kinds of methods and is being a
> little braver than I am in starting to explore the capabilities of
> eshell.

Some simple thing like that can call any external process async:

,----
| (defun tv-async-process (process &rest args)
|   (apply #'start-process process nil process
|          args))
`----

==> (tv-async-process "xterm" "-e" "lynx")
#<process xterm>

or

==> (tv-async-process "firefox" "http://www.emacswiki.org/cgi-bin/wiki")
#<process firefox>


-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-27 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 19:39 Asynchronous commands with eshell-command Michael Heerdegen
2009-01-27 16:09 ` Sebastian Tennant
2009-01-27 16:40   ` Thierry Volpiatto
2009-01-27 18:55     ` Sebastian Tennant
2009-01-27 19:51       ` Thierry Volpiatto
  -- strict thread matches above, loose matches on Subject: below --
2009-01-27 11:49 Nurullah Akkaya

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.