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|png|PNG)'
13 plumb start rc -c 'hget '''$0''' | page -w'
15 ## open urls with abaco web browser
17 #data matches 'https?://[a-zA-Z0-9_@\-]+([.:][a-zA-Z0-9_@\-]+)*/?[a-zA-Z0-9_?,%#~&/\-+=]+([:.][a-zA-Z0-9_?,''%#~&/\-+=;]+)*'
19 #plumb client window abaco
21 # rtf files go to wdoc2txt
23 data matches '[a-zA-Z¡-0-9_\-./]+'
24 data matches '([a-zA-Z¡-0-9_\-./]+)\.rtf'
27 plumb start wdoc2txt $file
29 # start rule for microsoft word documents without .doc suffix
33 plumb start wdoc2txt $file
35 # email addresses get a new mail window
37 data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
39 plumb start window rc -c '''echo % mail '''$0'; mail '$0
41 # image files go to page
43 data matches '[a-zA-Z¡-0-9_\-./]+'
44 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)'
49 # postscript/pdf/dvi/doc go to page but not over the a plumb port
50 # the port is here for reference but is unused
52 data matches '[a-zA-Z¡-0-9_\-./]+'
53 data matches '([a-zA-Z¡-0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC)'
56 plumb start page -w $file
58 # existing files, possibly tagged by line number, go to editor
60 data matches '([.a-zA-Z¡-0-9_/+\-]*[a-zA-Z¡-0-9_/+\-])('$addr')?'
65 plumb client window $editor
67 # .h files are looked up in /sys/include and passed to edit
69 data matches '([a-zA-Z¡-0-9]+\.h)('$addr')?'
70 arg isfile /sys/include/$1
74 plumb client window $editor
76 # .m files are looked up in /usr/inferno/module and passed to edit
78 data matches '([a-zA-Z¡-0-9]+\.m)('$addr')?'
79 arg isfile /usr/inferno/module/$1
83 plumb client window $editor
85 # faces -> new mail window for message
87 data matches '[a-zA-Z¡-0-9_\-./]+'
88 data matches '/mail/fs/[a-zA-Z¡-0-9/]+/[0-9]+'
90 plumb start window -r 4 120 750 600 upas/nedmail -s $0
92 # man index entries are synthesized
94 data matches '([a-zA-Z¡-0-9_\-./]+)\(([1-8])\)'
95 plumb start rc -c 'man -b '$2' '$1'
97 # RFC references are looked up in /lib/rfc and passed to editor
99 data matches 'RFC ?([0-9]+)'
100 arg isfile /lib/rfc/rfc$1
103 plumb client window $editor
105 # start rule for images without known suffixes
108 plumb client page -wi
110 # start rule for postscript without known suffixes
113 plumb start page -w $data
116 data matches 'Local (.*)'