In a previous blog entry (Goo URLs? No Thanks) I mentioned that I didn't want to encumber The Goo with having to address Things using http://really_long_unambiguous_urls/that/are/a/pain/to/type. But The Goo sticks Things together by association and hypertext offers the path of least resistance!
For example, ideally I want to browse my Perl code in hypertext and then jump straight to an editor and then jump back again as quickly as possible (to minimise context switching). A recent patch by Jonas Fonseca to the Elinks browser unfortunately didn't quite do what I needed but he suggested an even better solution: Goo URLs!
To enable your own protocol in Elinks all you need to do is add this to ~/.elinks/elinks.conf:
set protocol.user.goo.unix = "/home/search/dev/goo %u"I now have Goo URLs! This means if I want to edit a given method I can use a URL like this:
set protocol.user.goo.unix-xwin = "/home/search/dev/goo %u"
goo://?method=someMethodDeepInTheModule&filename=/tmp/MyModule.pmClicking on this URL launches an external text editor (e.g., nano, vi, emacs etc), starting at the appropriate line and means I can edit the file in place and jump back out again - quick!
It turns out the same method works in Firefox too. If you search on Trexy you will find my search trails for "firefox registered protocol". But here is a summary of what I found. To add a new protocol to Firefox do the following:
- Type "about:config" in the location bar.
- Right click, select New --> String.
- Name of string should be: "network.protocol-handler.app.goo"
- Value should be the path to your executable: "/home/search/dev/goo.sh"
#!/bin/bashThis means the Goo can be fully integrated with a graphical browser (Firefox) and a console based browser (Elinks) too.
# launch the editor in a new window
/usr/bin/konsole -e /home/search/dev/goo "$1"
There is now no technical impasse to traversing from high level tasks and ideas all the way down to editing, compiling and testing a small Perl script buried in the file system. Cool! ;-)
0 comments:
Post a Comment