[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Open Firefox from Emacs on MacOSX
From: |
Nikolaj Schumacher |
Subject: |
Re: Open Firefox from Emacs on MacOSX |
Date: |
Wed, 16 May 2007 00:39:49 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) |
Harald Hanche-Olsen <hanche@math.ntnu.no> writes:
> + Stefan Nobis <snobis@gmx.de>:
>
> | I'm new to MacOSX and just tried to setup (Carbon) Emacs (22.0.97) to open a
> | new Firefox (2.0) tab for e.g. browse-url-at-point:
> |
> | (setq browse-url-browser-function 'browse-url-firefox)
> | (setq browse-url-firefox-program
> "/Applications/Firefox.app/Contents/MacOS/firefox")
> |
> I run emacs 23, so I am not sure this is in emacs 22, but I think it's
> likely, in which case something like this works for me:
>
> (defun browse-url-firefox-on-mac (url &rest ignored)
> (do-applescript
> (format "tell application \"Firefox\" to Get URL \"%s\"" url)))
> (setq browse-url-browser-function 'browse-url-firefox-on-mac)
>
> Not sure what to do with any extra arguments.
I'm using the latest Emacs 22 from CVS, and `browse-url-at-point' works
out of the box. It uses `browse-url-default-macosx-browser'. If you
need to specify Firefox, you just need add an argument to the "open"
command.
(defun browse-url-firefox-macosx (url &optional new-window)
(interactive (browse-url-interactive-arg "URL: "))
(start-process (concat "open -a Firefox" url) nil "open" url))
(setq browse-url-browser-function 'browse-url-firefox-macosx)
regards,
Nikolaj Schumacher