1 #!/usr/local/plan9/bin/rc
7 # $1 - c1 origin of event
8 # $2 - c2 type of action
9 # $3 - q0 beginning of selection
10 # $4 - q1 end of selection
11 # $5 - eq0 beginning of expanded selection
12 # $6 - eq1 end of expanded selection
14 # $8 - nr number of runes in $9
16 # $10 - chorded argument
17 # $11 - origin of chorded argument
20 case E* # write to body or tag
21 case F* # generated by ourselves; ignore
22 case K* # type away we do not care
23 case Mi # mouse: text inserted in tag
24 case MI # mouse: text inserted in body
25 case Md # mouse: text deleted from tag
26 case MD # mouse: text deleted from body
28 case Mx MX # button 2 in tag or body
31 case Ml ML # button 3 in tag or body
36 dictwin /adict/$dict/$9 $dict $9
46 dict -d '?' >[2=1] | sed 1d | winwrite body
51 dict -d $dict $3 >[2=1] | winwrite body
64 dict=`{echo $1 | sed 's/-d//'}
68 echo 'usage: adict [-d dict] [word...]' >[1=2]
77 dictwin /adict/$dict/ $dict
80 dict=`{dict -d'?' | 9 sed -n 's/^ ([^\[ ]+).*/\1/p' | sed 1q}
82 echo 'no dictionaries present on this system' >[1=2]
87 dictwin /adict/$dict/$i $dict $i