tplumbing foo.html now sends it to the editor -- this is more in keeping with plan 9 behavior. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit dee84543e1d2f5d0deb684736305bbc27a2ab382
 (DIR) parent 73bef9b76b528d3fe92d7ab28d9b81b10e68b1fd
 (HTM) Author: rsc <devnull@localhost>
       Date:   Wed, 11 Aug 2004 02:16:07 +0000
       
       plumbing foo.html now sends it to the editor --
       tthis is more in keeping with plan 9 behavior.
       
       plumbing file:foo.html adds the appropriate
       full path and sends it to the web browser.
       
       Diffstat:
         M plumb/basic                         |      29 ++++++++++++++++++++++++-----
       
       1 file changed, 24 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/plumb/basic b/plumb/basic
       t@@ -7,17 +7,29 @@ include fileaddr
        plumb to seemail
        plumb to showmail
        
       +# relative files as file: urls get made into absolute paths
       +type is text
       +data matches 'file:([.a-zA-Z¡-￿0-9_\-]([.a-zA-Z¡-￿0-9_/\-]*[a-zA-Z¡-￿0-9_/\-]))?'
       +arg isfile        $1
       +data set        file://$file
       +plumb to web
       +plumb start web $data
       +
        # urls go to web browser
        type is text
        data matches '(https?|ftp|file|gopher|mailto|news|nntp|telnet|wais|prospero)://[a-zA-Z0-9_@\-]+([.:][a-zA-Z0-9_@\-]+)*/?[a-zA-Z0-9_?,%#~&/\-+=]+([:.][a-zA-Z0-9_?,%#~&/\-+=]+)*\.(jpe?g|JPE?G|gif|GIF|ps|PS|pdf|PDF)'
       +plumb to web
        plumb start web $0
        
        # html goes to web browser
       -type is text
       -data matches '[a-zA-Z¡-￿0-9_\-./]+'
       -data matches '([a-zA-Z¡-￿0-9_\-./]+)\.(html|htm|HTM|HTML)'
       -arg isfile        $0
       -plumb start web $file
       +# uncomment if you want this behavior
       +# commented out is more like plan 9
       +# 
       +# type is text
       +# data matches '[a-zA-Z¡-￿0-9_\-./]+'
       +# data matches '([a-zA-Z¡-￿0-9_\-./]+)\.(html|htm|HTM|HTML)'
       +# arg isfile        $0
       +# plumb start web $file
        
        # doc and rtf files go to wdoc2txt
        type is text
       t@@ -57,6 +69,13 @@ plumb to postscript
        plumb start psv $file
        # plumb start page -w $file
        
       +# open office - s[xt][cdigmw], doc, xls, ppt
       +data matches '[a-zA-Z¡-￿0-9_\-./]+'
       +data matches '([a-zA-Z¡-￿0-9_\-./]+)\.([Ss][XxTt][CcDdIiGgMmWw]|[Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt])'
       +arg isfile        $0
       +plumb to openoffice
       +plumb start openoffice $file
       +
        # existing files, possibly tagged by line number, go to editor
        type is text
        data matches '([.a-zA-Z¡-￿0-9_/\-]*[a-zA-Z¡-￿0-9_/\-])('$addr')?'