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 # cheap http/gif,jpeg,ps,pdf renderer
12 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)'
13 plumb start rc -c 'hget '$0' | page -w'
15 # doc and rtf files go to wdoc2txt
17 data matches '[a-zA-Z¡-0-9_\-./]+'
18 data matches '([a-zA-Z¡-0-9_\-./]+)\.(doc|rtf)'
21 plumb start wdoc2txt $file
23 # start rule for microsoft word documents without .doc suffix
27 plumb start wdoc2txt $file
29 # email addresses get a new mail window
31 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
33 plumb start window rc -c '''echo % mail '''$0'; mail '$0
35 # image files go to page
37 data matches '[a-zA-Z¡-0-9_\-./]+'
38 data matches '([a-zA-Z¡-0-9_\-./]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit)'
43 # postscript/pdf/dvi go to page but not over the a plumb port
44 # the port is here for reference but is unused
46 data matches '[a-zA-Z¡-0-9_\-./]+'
47 data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI)'
50 plumb start page -w $file
52 # existing files, possibly tagged by line number, go to editor
54 data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
59 plumb start /usr/local/plan9/bin/B $file:$3
60 # plumb client window $editor
62 # .h files are looked up in /sys/include and passed to edit
64 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
65 arg isfile /sys/include/$1
69 plumb start /usr/local/plan9/bin/B $file:$3
70 # plumb client window $editor
72 # .m files are looked up in /sys/module and passed to edit
74 data matches '([a-zA-Z¡-0-9]+\.m)('$addr')?'
75 arg isfile /sys/module/$1
79 plumb start /usr/local/plan9/bin/B $file:$3
80 # plumb client window $editor
82 # faces -> new mail window for message
84 data matches '[a-zA-Z¡-0-9_\-./]+'
85 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
87 plumb start window -r 4 120 750 600 upas/nedmail -s $0
89 # man index entries are synthesized
91 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
92 plumb start rc -c 'man '$2' '$1' >[2=1] | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''
94 # start rule for images without known suffixes
99 # start rule for postscript without known suffixes
102 plumb start page -w $data
105 data matches 'Local (.*)'