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_?,%#~&/\-+=]+)*\.(jpe?g|JPE?G|gif|GIF|ps|PS|pdf|PDF)'
24 # html goes to web browser
25 # uncomment if you want this behavior
26 # commented out is more like plan 9
29 # data matches '[a-zA-Z¡-0-9_\-./]+'
30 # data matches '([a-zA-Z¡-0-9_\-./]+)\.(html|htm|HTM|HTML)'
32 # plumb start web $file
34 # doc and rtf files go to wdoc2txt
36 data matches '[a-zA-Z¡-0-9_\-./]+'
37 data matches '([a-zA-Z¡-0-9_\-./]+)\.(doc|rtf)'
40 plumb start wdoc2txt $file
42 # start rule for microsoft word documents without .doc suffix
46 plumb start wdoc2txt $file
48 # email addresses get a new mail window
50 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
53 # plumb start window rc -c '''echo % mail '''$0'; mail '$0
55 # image files go to page
57 data matches '[a-zA-Z¡-0-9_\-./]+'
58 data matches '([a-zA-Z¡-0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG)'
61 plumb start page $file
63 # postscript/pdf/dvi go to page but not over the a plumb port
64 # the port is here for reference but is unused
66 data matches '[a-zA-Z¡-0-9_\-./]+'
67 data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)'
70 plumb start page $file
72 # open office - s[xt][cdigmw], doc, xls, ppt
73 data matches '[a-zA-Z¡-0-9_\-./]+'
74 data matches '([a-zA-Z¡-0-9_\-./]+)\.([Ss][XxTt][CcDdIiGgMmWw]|[Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt])'
77 plumb start openoffice $file
79 # existing files, possibly tagged by line number, go to editor
81 data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
88 # .h files are looked up in /usr/include and passed to edit
90 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
91 arg isfile /usr/include/$1
97 # .h files are looked up in /usr/local/include and passed to edit
99 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
100 arg isfile /usr/local/include/$1
106 # .h files are looked up in $plan9/include and passed to edit
108 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
109 arg isfile $plan9/include/$1
115 # .m files are looked up in /sys/module and passed to edit
117 data matches '([a-zA-Z¡-0-9]+\.m)('$addr')?'
118 arg isfile /sys/module/$1
122 plumb client window $editor
124 # faces -> new mail window for message
126 data matches '[a-zA-Z¡-0-9_\-./]+'
127 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
129 plumb start window -r 4 120 750 600 upas/nedmail -s $0
131 # man index entries are synthesized
133 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
134 plumb start rc -c 'man '$2' '$1' >[2=1] | nobs | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''
136 # start rule for images without known suffixes
140 plumb start page $data
142 # start rule for postscript without known suffixes
145 plumb start page $data