From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Molen Newsgroups: gmane.emacs.help Subject: Re: get browse-url to use mozilla-firebird Date: Fri, 13 Feb 2004 00:11:38 GMT Organization: RoadRunner - West Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076631490 23267 80.91.224.253 (13 Feb 2004 00:18:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Feb 2004 00:18:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 13 01:17:59 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ArR1q-0005Bb-00 for ; Fri, 13 Feb 2004 01:17:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArR0K-0008N8-Pv for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Feb 2004 19:16:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!cyclone.socal.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.socal.rr.com.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 155 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-NNTP-Posting-Host: 66.74.188.157 Original-X-Complaints-To: abuse@rr.com Original-X-Trace: twister.socal.rr.com 1076631098 66.74.188.157 (Thu, 12 Feb 2004 16:11:38 PST) Original-NNTP-Posting-Date: Thu, 12 Feb 2004 16:11:38 PST Original-Xref: shelby.stanford.edu gnu.emacs.help:120862 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:16810 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16810 Richard Molen writes: > How do I convince emacs 2.3.1's browse-url-at-point to use > the mozilla-firebird browser instead of the mozilla one? > > This works great for Mozilla. > > ; Use Mozilla as default browser on Red Hat 7.3 or 8.0 Linux w/ > ; Gnome support. (For Emacs 21.2.1 and 21.3.1) > (setq browse-url-browser-function 'browse-url-gnome-moz) > > After 'Google'ing I found some help on getting mozilla-firebird to act > the same way. This is what I have now. > > ; Use Mozilla Firebird (was Phoenix) on Fedora Core 1 > (defun browse-url-mozilla-firebird (url arg) > (shell-command > (format "/usr/bin/mozilla-firebird -remote 'openURL(%s, new-tab)'" > url))) > (setq browse-url-browser-function 'browse-url-mozilla-firebird) > > The browse-url-gnome-moz functions calls the GNOME program > gnome-moz-remote rather than directly calling /usr/bin/mozilla. This > which seems undesirable to me (since I occasionally use KDE too). > Well I've answered my own question (to my satisfaction at least). I thought it could be done in an emacs function, but this setup seems to work. Do the following to make Mozilla Firebird (now called Firefox) the browser that emacs uses when using 'browse-url-at-point' and such. This allows the emacs user to: 1. open the URL in a browser if no browser is open yet. 2. opoen the URL in a tab of the browser if it is already open. Firebird allows opening a tab (new web page) in the background while keeping the alredy opened page in view. For better or worse, this code does not do background loading. This code works in GNOME or KDE, so long as GNOME is installed. It should work on Red Hat and Fedora Core Linux boxes. If you are using the latest version of 'Firebird' then change the names to Firefox as appropriate. A free bonus hack for default GNOME-Nautilus browser is offered at the end too. ...as root, make a bash script... emacs /usr/bin/firebird-remote ...paste in the following. If confused, read the URLs.... ----------------- cut ------------------------- #!/bin/sh # For starting firebird as default browser in gnome # http://www.mozilla.org/unix/remote.html # http://lists.freebsd.org/pipermail/freebsd-gnome/2003-November/003907.html FIREBIRD_NAME="firebird" #FIREBIRD_NAME="firefox" FIREBIRD_CMD="/usr/bin/mozilla-$FIREBIRD_NAME" if [ "$1x" = "x" ]; then URL="about:black" else URL=$1 fi FIREBIRD_REMOTE="openURL(${URL},new-tab)" ${FIREBIRD_CMD} -remote "ping()" && ${FIREBIRD_CMD} -remote ${FIREBIRD_REMOTE} && exit 0 ${FIREBIRD_CMD} ${URL} exit 0 # http://linuxgazette.net/issue97/shekhar.html -- suggests this code /usr/lib/mozilla-firebird/MozillaFirebird -remote "openURL($@, new-tab)" || exec /usr/lib/mozilla-firebird/MozillaFirebird "$@" ; ----------------- cut ------------------------- ...make it executable... chmod a+x ...in your home directory... cd ~/.gnome ... make this file... emacs gnome-moz-remote ...paste this in... ----------------- cut ------------------------- [Mozilla] filename=/usr/bin/firebird-remote NEEDS_TERM=false NREMOTE=true ----------------- cut ------------------------- ...in your initialization file... emacs .emacs ----------------- cut ------------------------- ; Use Mozilla as default browser for emacs 21.2.1, 21.3.1 ; On Red Hat Linux 7.3, 8.0, 9, and Fedora Core 1 Linux ; Needs Gnome support: gnome-moz-remote to run in Gnome or KDE ; Also /usr/bin/firebird-remote & ~/.gnome/gnome-moz-remote (setq browse-url-browser-function 'browse-url-gnome-moz browse-url-generic-program nil browse-url-netscape-display nil browse-url-new-window-flag nil browse-url-save-file nil ) ----------------- cut ------------------------- ...test with these URLs... www.yahoo.com www.google.com http://www.mozilla.org/unix/remote.html ...and as a bonus, to get firebird working with GNOME 2.4 and Nautilus 2.4 on Fedora Core 1 (and presumably RedHat), I had to do the following... 1. Open the 'Home' folder on the desktop. This displays my home dir. 2. find an html file and right-click, select Open With..., Other Application..., Go There... 3. Edit file type: select Default action: Custom and enter 'firebird-remote' for the 'Program to run', select 'OK'. 4. Open "Start Here" on the desktop and select "Preferred Applications". Select "Web Browser" tab and choose "Custom Web Browser" and enter Command: firebird-remote %s ...then choose close. 5. While it may not be needed, I logged out of GNOME, logged out and then logged back in and ran 'startx'. ...I'm hardly a GNOME expert, perhaps there is a cleaner way to do this... That's it. -- {{}, Richard Molen (@ @) ,.(_),. "Furious activity is no substitute for / / ooOo oOoo \ \ understanding" -- H. H. Williams / /_____________\ \ / ' '