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 # open urls with web browser
12 data matches 'https?://[^ ]+'
14 plumb client window $browser
16 # rtf files go to wdoc2txt
18 data matches '[a-zA-Z¡-0-9_\-.,/]+'
19 data matches '([a-zA-Z¡-0-9_\-.,/]+)\.rtf'
22 plumb start wdoc2txt $file
24 # start rule for microsoft word documents without .doc suffix
28 plumb start wdoc2txt $file
30 # email addresses get a new mail window
32 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
34 plumb start window rc -c '''echo % mail '''$0'; mail '$0
38 data matches '[a-zA-Z¡-0-9_\-.,/]+'
39 data matches '([a-zA-Z¡-0-9_\-.,/]+)\.(mp3|ogg|flac|m3u|pls)'
42 plumb start window -scroll play $file
44 # image files go to page
46 data matches '[a-zA-Z¡-0-9_\-.,/]+'
47 data matches '([a-zA-Z¡-0-9_\-.,/]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|PPM|bit|BIT|png|PNG|pgm|PGM|bmp|BMP|yuv|YUV)'
54 data matches '(([a-zA-Z¡-0-9_\-.,/]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC|epub|EPUB|cb[tz]|CB[TZ]))!(.+)'
59 plumb start page -wij $file!$4 $file
61 # postscript/pdf/dvi/doc go to page but not over the a plumb port
62 # the port is here for reference but is unused
64 data matches '[a-zA-Z¡-0-9_\-.,/]+'
65 data matches '([a-zA-Z¡-0-9_\-.,/]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC|epub|EPUB|cb[tz]|CB[TZ])'
68 plumb start page -w $file
70 # existing files, possibly tagged by line number, go to editor
72 data matches '([.a-zA-Z¡-0-9_/+\-]*[a-zA-Z¡-0-9_/+\-])('$addr')?'
77 plumb client window $editor
79 # .h files are looked up in /sys/include and passed to edit
81 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
82 arg isfile /sys/include/$1
86 plumb client window $editor
88 # .m files are looked up in /usr/inferno/module and passed to edit
90 data matches '([a-zA-Z¡-0-9]+\.m)('$addr')?'
91 arg isfile /usr/inferno/module/$1
95 plumb client window $editor
97 # faces -> new mail window for message
99 data matches '[a-zA-Z¡-0-9_\-./]+'
100 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
102 plumb start window -r 4 120 750 600 upas/nedmail -s $0
104 # man index entries are synthesized
106 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
107 plumb start rc -c 'man -b '$2' '$1'
109 # RFC references are looked up in /lib/rfc and passed to editor
111 data matches 'RFC ?([0-9]+)'
112 arg isfile /lib/rfc/rfc$1
115 plumb client window $editor
117 # start rule for images without known suffixes
120 plumb client page -wi
122 # start rule for postscript without known suffixes
125 plumb start page -w $data
128 data matches 'Local (.*)'