aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love <[email protected]>2000-01-05 15:41:44 +0000
committerDave Love <[email protected]>2000-01-05 15:41:44 +0000
commitc7f836c751befc88c4c2c230ce1fc4128fcfc893 (patch)
tree0fe25db0cd23e40c173f7cd6e259cff4b10ef8fe /lisp
parenta2cc2b283ec249ff3bf570531249cd6dee1876ad (diff)
(browse-url): Fix case of browse-url-browser-function being an alist.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/browse-url.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/lisp/browse-url.el b/lisp/browse-url.el
index a4e4fcae1d..ba3c767796 100644
--- a/lisp/browse-url.el
+++ b/lisp/browse-url.el
@@ -1,6 +1,6 @@
;;; browse-url.el --- Pass a URL to a WWW browser
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 96-99, 2000 Free Software Foundation, Inc.
;; Author: Denis Howe <[email protected]>
;; Maintainer: Dave Love <[email protected]>
@@ -85,9 +85,8 @@
;; Python see <url:http://www.python.org/>. Grail support in
;; browse-url.el written by Barry Warsaw <[email protected]>.
-;; MMM is the freely available WWW browser implemented in Objective
-;; Caml, a cool impure functional programming language, by Francois
-;; Rouaix. See the MMM home page
+;; MMM is a semi-free WWW browser implemented in Objective Caml, an
+;; interesting impure functional programming language. See
;; <URL:http://pauillac.inria.fr/%7Erouaix/mmm/>.
;; Lynx is now distributed by the FSF. See also
@@ -98,7 +97,8 @@
;; <URL:http://www.unlv.edu/chimera/>, Arena
;; <URL:ftp://ftp.yggdrasil.com/pub/dist/web/arena> and Amaya
;; <URL:ftp://ftp.w3.org/pub/amaya>. mMosaic
-;; <URL:ftp://sig.enst.fr/pub/multicast/mMosaic/> (with development
+;; <URL:ftp://sig.enst.fr/pub/multicast/mMosaic/>,
+;; <URL:http://sig.enst.fr/~dauphin/mMosaic/> (with development
;; support for Java applets and multicast) can be used like Mosaic by
;; setting `browse-url-mosaic-program' appropriately.
@@ -223,6 +223,7 @@
(eval-when-compile (require 'thingatpt)
(require 'term)
+ (require 'dired)
(require 'w3-auto nil t))
(defgroup browse-url nil
@@ -598,16 +599,19 @@ narrowed."
Prompts for a URL, defaulting to the URL at or before point. Variable
`browse-url-browser-function' says which browser to use."
(interactive (browse-url-interactive-arg "URL: "))
- (let ((bf browse-url-browser-function) re)
- (unless (functionp bf)
- (while (consp bf)
- (setq re (car (car bf))
- bf (if (string-match re url)
- (cdr (car bf)) ; The function
- (cdr bf))))) ; More pairs
- (or bf (error "No browser in browse-url-browser-function matching URL %s"
- url))
- (apply bf url args)))
+ (if (functionp browse-url-browser-function)
+ (apply browse-url-browser-function url args)
+ ;; The `function' can be an alist; look down it for first match
+ ;; and apply the function (which might be a lambda).
+ (catch 'done
+ (mapcar
+ (lambda (bf)
+ (when (string-match (car bf) url)
+ (apply (cdr bf) url args)
+ (throw 'done t)))
+ browse-url-browser-function)
+ (error "No browser in browse-url-browser-function matching URL %s"
+ url))))
;;;###autoload
(defun browse-url-at-point ()