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