1 # these are generally in order from most specific to least,
2 # since first rule that fires wins.
6 # declarations of ports without rules
10 # relative files as file: urls get made into absolute paths
12 data matches 'file:([.a-zA-Z¡-0-9_\-]([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-]))?'
18 # urls go to web browser
20 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_?,%#~&/\-+=]+)*'
24 # doc and rtf files go to wdoc2txt
26 data matches '[a-zA-Z¡-0-9_\-./]+'
27 data matches '([a-zA-Z¡-0-9_\-./]+)\.(doc|rtf)'
30 plumb start wdoc2txt $file
32 # start rule for microsoft word documents without .doc suffix
36 plumb start wdoc2txt $file
38 # image files go to page
40 data matches '[a-zA-Z¡-0-9_\-./]+'
41 data matches '([a-zA-Z¡-0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG)'
44 plumb start 9 page $file
46 # postscript/pdf/dvi go to page but not over the a plumb port
47 # the port is here for reference but is unused
49 data matches '[a-zA-Z¡-0-9_\-./]+'
50 data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)'
53 plumb start 9 page $file
55 # open office - s[xt][cdigmw], doc, xls, ppt
56 data matches '[a-zA-Z¡-0-9_\-./]+'
57 data matches '([a-zA-Z¡-0-9_\-./]+)\.([Ss][XxTt][CcDdIiGgMmWw]|[Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt])'
60 plumb start openoffice $file
62 # existing files tagged by line number:columnumber or linenumber.columnumber, go to editor
64 data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])'$twocolonaddr'
67 attr add addr=$2-#1+#$3
71 # existing files, possibly tagged by line number, go to editor
73 data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
80 # .h files are looked up in /usr/include and passed to edit
82 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
83 arg isfile /usr/include/$1
89 # .h files are looked up in /usr/local/include and passed to edit
91 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
92 arg isfile /usr/local/include/$1
98 # .h files are looked up in $plan9/include and passed to edit
100 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
101 arg isfile $plan9/include/$1
107 # .m files are looked up in /usr/inferno/module and passed to edit
109 data matches '([a-zA-Z¡-0-9/_\-]+\.m)('$addr')?'
110 arg isfile /usr/inferno/module/$1
114 plumb client window $editor
116 # faces -> new mail window for message
118 data matches '[a-zA-Z¡-0-9_\-./]+'
119 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
121 plumb start window -r 4 120 750 600 upas/nedmail -s $0
123 # email addresses get a new mail window
125 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
128 # plumb start window rc -c '''echo % mail '''$0'; mail '$0
130 # man index entries are synthesized
132 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
133 plumb start rc -c 'man '$2' '$1' >[2=1] | nobs | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''
135 # start rule for images without known suffixes
139 plumb start 9 page $data
141 # start rule for postscript without known suffixes
144 plumb start 9 page $data