[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MacOS X support in browse-url

From: David Charlap
Subject: MacOS X support in browse-url
Date: Sat, 22 Feb 2003 11:28:09 -0500
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3b) Gecko/20030212

I'm running Emacs 21.3.50 on MacOS X version 10.2.4.

By default, the (browse-url) function does not work on MacOS X. It fails to find any browser on the search path (which makes sense, because there isn't any), and then fails to load w3 (unless you have it installed).

I wrote this small bit of LISP to get it to call the system's "open" command which, when given a URL, will launch the system-configured web browser:

(defun browse-url-default-macosx-browser (url &optional new-window)
  "Ask MacOS to load URL using the system-default web browser."

  (interactive (browse-url-interactive-arg "URL: "))
  (start-process "browser" nil "open" url)

(setq browse-url-browser-function 'browse-url-default-macosx-browser)

Please review this function and include it in an appropriate way in the browse-url.el source file of the next Emacs release.

Thanks in advance.

-- David

reply via email to

[Prev in Thread] Current Thread [Next in Thread]