aboutsummaryrefslogtreecommitdiff
path: root/lib/acme.rc
blob: 8218f90651618a3503775748b4e23d8280977d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
fn newwindow {
	winctl=`{9p read acme/new/ctl}
	winid=$winctl(1)
	winctl noscroll
}

fn winctl {	
	echo $* | 9p write acme/$winid/ctl
}

fn winread {
	9p read acme/$winid/$1
}

fn winwrite {
	9p write acme/$winid/$1
}

fn windump {
	if(! ~ $1 - '')
		winctl dumpdir $1
	if(! ~ $2 - '')
		winctl dump $2
}

fn winname {
	winctl name $1
}

fn winwriteevent {
	echo $1$2$3 $4 | winwrite event
}

fn windel {
	if(~ $1 sure)
		winctl delete
	if not
		winctl del
}

fn wineventloop {
	. <{winread event >[2]/dev/null | acmeevent}
}