From: Vektor <XYZvektorXYZ@XYZyeahXYZ.net>
Subject: Re: run shell-command in the background?
Date: Wed, 25 Aug 2004 08:44:41 +0800 [thread overview]
Message-ID: <cggnpe$uft$1@quimby.gnus.org> (raw)
In-Reply-To: x5r7pwxexy.fsf@lola.goethe.zz
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.
next prev parent reply other threads:[~2004-08-25 0:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2004-08-25 0:15 ` Kevin Rodgers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='cggnpe$uft$1@quimby.gnus.org' \
--to=xyzvektorxyz@xyzyeahxyz.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).