unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* run shell-command in the background?
@ 2004-08-24 23:51 Vektor
  2004-08-25  0:02 ` David Kastrup
  2004-08-25  0:15 ` Kevin Rodgers
  0 siblings, 2 replies; 4+ messages in thread
From: Vektor @ 2004-08-24 23:51 UTC (permalink / raw)


if i use (shell-command "my-script"), the emacs will run the script
and freeze itself.
is it possible to run a shell command in the background?


ps: actually, this script is named "runmoz", it handle the "open
new-tab in an already running mozilla, otherwise start a mozilla"
stuff. 


-- 
Remove all XYZ from my email to get the real one.

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

* Re: run shell-command in the background?
  2004-08-24 23:51 run shell-command in the background? Vektor
@ 2004-08-25  0:02 ` David Kastrup
  2004-08-25  0:44   ` Vektor
  2004-08-25  0:15 ` Kevin Rodgers
  1 sibling, 1 reply; 4+ messages in thread
From: David Kastrup @ 2004-08-25  0:02 UTC (permalink / raw)


Vektor <XYZvektorXYZ@XYZyeahXYZ.net> writes:

> if i use (shell-command "my-script"), the emacs will run the script
> and freeze itself.
> is it possible to run a shell command in the background?
> 
> 
> ps: actually, this script is named "runmoz", it handle the "open
> new-tab in an already running mozilla, otherwise start a mozilla"
> stuff. 

You know browse-url ?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: run shell-command in the background?
  2004-08-24 23:51 run shell-command in the background? Vektor
  2004-08-25  0:02 ` David Kastrup
@ 2004-08-25  0:15 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2004-08-25  0:15 UTC (permalink / raw)


Vektor wrote:
 > if i use (shell-command "my-script"), the emacs will run the script
 > and freeze itself.
 > is it possible to run a shell command in the background?

(shell-command "my-script &")

-- 
Kevin Rodgers

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

* Re: run shell-command in the background?
  2004-08-25  0:02 ` David Kastrup
@ 2004-08-25  0:44   ` Vektor
  0 siblings, 0 replies; 4+ messages in thread
From: Vektor @ 2004-08-25  0:44 UTC (permalink / raw)


actually this is what i am doing.

the runmoz script is good so that  even i C-g when emacs freeze, the
mozilla will continue running without exit.

but "shell-command &" will do nothing good.



this is from my .emacs.el
---------------------------------------------------------------
;; browser url with mozilla
(when window-system
  (setq browse-url-browser-function 'browse-url-mozilla)
  (setq browse-url-mozilla-program "runmoz")
  (defun browse-url-mozilla (url &optional new-window)
    ;; new-window ignored
    "Open URL in a new tab in Mozilla."
    (interactive (browse-url-interactive-arg "URL: "))
    (message "Starting Mozilla...")
    (shell-command (concat browse-url-mozilla-program " " url))
    (message "Starting Mozilla...done"))
  )
---------------------------------------------------------------

runmoz
----------------------------------------------------------------
#!/bin/sh
#run new url in
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
# my mozilla need some lib to be loaded

MOZ_PATH=/usr/local/tools/mozilla-1.7/bin

if [ $# = 0 ]; then

    $MOZ_PATH/mozilla -remote 'ping()' &> /dev/null
    if ! [ $? = 0 ]; then
        $MOZ_PATH/mozilla & > /dev/null &
    fi

else
    $MOZ_PATH/mozilla -remote "openURL($1,new-tab)" &> /dev/null
    if ! [ $? = 0 ]; then
        $MOZ_PATH/mozilla "$1" & > /dev/null &
    fi
fi
-----------------------------------------------------------------


David Kastrup <dak@gnu.org> writes:

> Vektor <XYZvektorXYZ@XYZyeahXYZ.net> writes:
>
>> if i use (shell-command "my-script"), the emacs will run the script
>> and freeze itself.
>> is it possible to run a shell command in the background?
>> 
>> 
>> ps: actually, this script is named "runmoz", it handle the "open
>> new-tab in an already running mozilla, otherwise start a mozilla"
>> stuff. 
>
> You know browse-url ?
>
> -- 
> David Kastrup, Kriemhildstr. 15, 44793 Bochum

-- 
Remove all XYZ from my email to get the real one.

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

end of thread, other threads:[~2004-08-25  0:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-24 23:51 run shell-command in the background? Vektor
2004-08-25  0:02 ` David Kastrup
2004-08-25  0:44   ` Vektor
2004-08-25  0:15 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).