diff options
Diffstat (limited to 'stdlib/doc-lookup.tl')
-rw-r--r-- | stdlib/doc-lookup.tl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/stdlib/doc-lookup.tl b/stdlib/doc-lookup.tl index 1d02049e..110d37d4 100644 --- a/stdlib/doc-lookup.tl +++ b/stdlib/doc-lookup.tl @@ -28,11 +28,21 @@ (caseql os-symbol ((:linux :macos :solaris :solaris10 :android) (defun open-url (url) - (detached-run (caseql os-symbol + (let ((opener (caseql os-symbol ((:linux :solaris :android) "xdg-open") (:solaris10 "/usr/dt/bin/sdtwebclient") - (:macos "open")) - (list url)))) + (:macos "open"))) + (fallback '#"firefox iceweasel seamonkey mozilla \ + epiphany konqueror chromium chromium-browser \ + google-chrome")) + (let ((prog (or (getenv "BROWSER") + (if (abs-path-p opener) + opener + (path-search opener)) + [find-true path-search fallback]))) + (if prog + (detached-run prog (list url)) + (error "~s: no URL-opening method available" 'open-url)))))) ((:cygwin :cygnal) (with-dyn-lib "shell32.dll" (deffi shell-execute "ShellExecuteW" |