basic 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # these are generally in order from most specific to least,
  2. # since first rule that fires wins.
  3. include fileaddr
  4. # declarations of ports without rules
  5. plumb to seemail
  6. plumb to showmail
  7. # cheap http/gif,jpeg,ps,pdf renderer
  8. type is text
  9. 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)'
  10. plumb start rc -c 'hget '''$0''' | page -w'
  11. ## open urls with abaco web browser
  12. #type is text
  13. #data matches 'https?://[a-zA-Z0-9_@\-]+([.:][a-zA-Z0-9_@\-]+)*/?[a-zA-Z0-9_?,%#~&/\-+=]+([:.][a-zA-Z0-9_?,''%#~&/\-+=;]+)*'
  14. #plumb to web
  15. #plumb client window abaco
  16. # rtf files go to wdoc2txt
  17. type is text
  18. data matches '[a-zA-Z¡-￿0-9_\-./]+'
  19. data matches '([a-zA-Z¡-￿0-9_\-./]+)\.rtf'
  20. arg isfile $0
  21. plumb to msword
  22. plumb start wdoc2txt $file
  23. # start rule for microsoft word documents without .doc suffix
  24. type is text
  25. dst is msword
  26. plumb to msword
  27. plumb start wdoc2txt $file
  28. # email addresses get a new mail window
  29. type is text
  30. data matches '[a-zA-Z0-9_+.\-]+@[a-zA-Z0-9_+.\-]*'
  31. plumb to sendmail
  32. plumb start window rc -c '''echo % mail '''$0'; mail '$0
  33. # image files go to page
  34. type is text
  35. data matches '[a-zA-Z¡-￿0-9_\-./]+'
  36. 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)'
  37. arg isfile $0
  38. plumb to image
  39. plumb client page -wi
  40. # postscript/pdf/dvi/doc go to page but not over the a plumb port
  41. # the port is here for reference but is unused
  42. type is text
  43. data matches '[a-zA-Z¡-￿0-9_\-./]+'
  44. data matches '([a-zA-Z¡-￿0-9_\-./]+)\.(ps|PS|eps|EPS|pdf|PDF|dvi|DVI|doc|DOC)'
  45. arg isfile $0
  46. plumb to postscript
  47. plumb start page -w $file
  48. # existing files, possibly tagged by line number, go to editor
  49. type is text
  50. data matches '([.a-zA-Z¡-￿0-9_/+\-]*[a-zA-Z¡-￿0-9_/+\-])('$addr')?'
  51. arg isfile $1
  52. data set $file
  53. attr add addr=$3
  54. plumb to edit
  55. plumb client window $editor
  56. # .h files are looked up in /sys/include and passed to edit
  57. type is text
  58. data matches '([a-zA-Z¡-￿0-9]+\.h)('$addr')?'
  59. arg isfile /sys/include/$1
  60. data set $file
  61. attr add addr=$3
  62. plumb to edit
  63. plumb client window $editor
  64. # .m files are looked up in /usr/inferno/module and passed to edit
  65. type is text
  66. data matches '([a-zA-Z¡-￿0-9]+\.m)('$addr')?'
  67. arg isfile /usr/inferno/module/$1
  68. data set $file
  69. attr add addr=$3
  70. plumb to edit
  71. plumb client window $editor
  72. # faces -> new mail window for message
  73. type is text
  74. data matches '[a-zA-Z¡-￿0-9_\-./]+'
  75. data matches '/mail/fs/[a-zA-Z¡-￿0-9/]+/[0-9]+'
  76. plumb to showmail
  77. plumb start window -r 4 120 750 600 upas/nedmail -s $0
  78. # man index entries are synthesized
  79. type is text
  80. data matches '([a-zA-Z¡-￿0-9_\-./]+)\(([1-8])\)'
  81. plumb start rc -c 'man -b '$2' '$1'
  82. # RFC references are looked up in /lib/rfc and passed to editor
  83. type is text
  84. data matches 'RFC ?([0-9]+)'
  85. arg isfile /lib/rfc/rfc$1
  86. data set $file
  87. plumb to edit
  88. plumb client window $editor
  89. # start rule for images without known suffixes
  90. dst is image
  91. plumb to image
  92. plumb client page -wi
  93. # start rule for postscript without known suffixes
  94. dst is postscript
  95. arg isfile $data
  96. plumb start page -w $data
  97. type is text
  98. data matches 'Local (.*)'
  99. plumb to none
  100. plumb start rc -c $1