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 # email addresses get a new mail window
40 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
43 # plumb start window rc -c '''echo % mail '''$0'; mail '$0
45 # image files go to page
47 data matches '[a-zA-Z¡-0-9_\-./]+'
48 data matches '([a-zA-Z¡-0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG)'
51 plumb start 9 page $file
53 # postscript/pdf/dvi go to page but not over the a plumb port
54 # the port is here for reference but is unused
56 data matches '[a-zA-Z¡-0-9_\-./]+'
57 data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)'
60 plumb start 9 page $file
62 # open office - s[xt][cdigmw], doc, xls, ppt
63 data matches '[a-zA-Z¡-0-9_\-./]+'
64 data matches '([a-zA-Z¡-0-9_\-./]+)\.([Ss][XxTt][CcDdIiGgMmWw]|[Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt])'
67 plumb start openoffice $file
69 # existing files, possibly tagged by line number, go to editor
71 data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
78 # .h files are looked up in /usr/include and passed to edit
80 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
81 arg isfile /usr/include/$1
87 # .h files are looked up in /usr/local/include and passed to edit
89 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
90 arg isfile /usr/local/include/$1
96 # .h files are looked up in $plan9/include and passed to edit
98 data matches '([a-zA-Z¡-0-9/_\-]+\.h)('$addr')?'
99 arg isfile $plan9/include/$1
105 # .m files are looked up in /sys/module and passed to edit
107 data matches '([a-zA-Z¡-0-9/_\-]+\.m)('$addr')?'
108 arg isfile /sys/module/$1
112 plumb client window $editor
114 # faces -> new mail window for message
116 data matches '[a-zA-Z¡-0-9_\-./]+'
117 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
119 plumb start window -r 4 120 750 600 upas/nedmail -s $0
121 # man index entries are synthesized
123 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
124 plumb start rc -c 'man '$2' '$1' >[2=1] | nobs | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''
126 # start rule for images without known suffixes
130 plumb start 9 page $data
132 # start rule for postscript without known suffixes
135 plumb start 9 page $data