Clojure

Make browse-url aware of xdg-open

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
    None
  • Environment:
    All platforms that provide xdg-open (as part of freedesktop.org) benefit from this. Fix was tested on OpenBSD.
  • Patch:
    Code
  • Approval:
    Ok

Description

clojure.java.browse/browse-url tests to see if it's running on Mac OS to fall back to "/usr/bin/open" in order
to open a URI. On most other systems it'll just falls through to open-url-in-swing instead. The attached patch
tests to see if freedesktop.org's "xdg-open" is present in the users path. This way browse-url will launch the
program associated with the URI, in my case chromium.

Activity

Hide
Jasper Lievisse Adriaanse added a comment -

And I've tested it on OpenBSD.

Show
Jasper Lievisse Adriaanse added a comment - And I've tested it on OpenBSD.
Hide
Stuart Sierra added a comment -

Screened. Verified on Mac OS X.

Show
Stuart Sierra added a comment - Screened. Verified on Mac OS X.
Hide
Andy Fingerhut added a comment -

clj-896-browse-url-uses-xdg-open-patch2.txt is based more on the patch attached to CLJ-920 by Jeremy Heiler than on the earlier patch attached to this ticket. He and I have signed CAs.

I think this patch improves on both of the previous patches for CLJ-896 and CLJ-920. In particular, Jeremy's worked fine, but it caused a long slowdown in the running of tests when building Clojure. This one does not.

Tested on:

Mac OS X 10.6.8
Windows XP SP3, both in cmd.exe and a Cygwin bash shell
Ubuntu 10.04 LTS

It would be great if someone could test it on a BSD system. The only possible issue I can think of is whether the output of the "which" command is different there than on the Linux system I tested.

If someone wants to make a patch that doesn't use "which", but instead checks the PATH, I'd recommend they also test on Windows in cmd.exe to make sure it works correctly there.

Show
Andy Fingerhut added a comment - clj-896-browse-url-uses-xdg-open-patch2.txt is based more on the patch attached to CLJ-920 by Jeremy Heiler than on the earlier patch attached to this ticket. He and I have signed CAs. I think this patch improves on both of the previous patches for CLJ-896 and CLJ-920. In particular, Jeremy's worked fine, but it caused a long slowdown in the running of tests when building Clojure. This one does not. Tested on: Mac OS X 10.6.8 Windows XP SP3, both in cmd.exe and a Cygwin bash shell Ubuntu 10.04 LTS It would be great if someone could test it on a BSD system. The only possible issue I can think of is whether the output of the "which" command is different there than on the Linux system I tested. If someone wants to make a patch that doesn't use "which", but instead checks the PATH, I'd recommend they also test on Windows in cmd.exe to make sure it works correctly there.
Hide
Andy Fingerhut added a comment -

CLJ-920, if not identical, at least bears a significant resemblance to this ticket. It would be good to see if the patch for one of them fixes both issues.

Show
Andy Fingerhut added a comment - CLJ-920, if not identical, at least bears a significant resemblance to this ticket. It would be good to see if the patch for one of them fixes both issues.

People

Vote (3)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: