summaryrefslogtreecommitdiff
path: root/sys/src/cmd/acme/exec.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-06-06 19:05:00 -0700
committerOri Bernstein <ori@eigenstate.org>2020-06-06 19:05:00 -0700
commitd2be4787c6e78df1a0fec1f6fdc75a616ecc1e1e (patch)
tree1cc9b71c9c5b634b75ce3f7edfd55fa5afefee73 /sys/src/cmd/acme/exec.c
parente46000f076b3b5389b60f4497c8b40c203202d84 (diff)
acme: import event log from plan9port (thanks fshahriar)
Based off the following 3 commits: 4a3fb87264f8bc03fc62f00ef335056f30d18023 45f8ba54143323f08a21343633764caa59aa3ea3 fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41 Reading /mnt/acme/log reports a log of window create, put, focus, and delete events, as they happen. It blocks until the next event is available. Example log output: 8 new /Users/rsc/foo.go 8 put /Users/rsc/foo.go 8 del /Users/rsc/foo.go This lets acme-aware programs react to file writes, for example compiling code, running a test, or updating an import block.
Diffstat (limited to 'sys/src/cmd/acme/exec.c')
-rw-r--r--sys/src/cmd/acme/exec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/src/cmd/acme/exec.c b/sys/src/cmd/acme/exec.c
index a975f56c9..7011ad7b3 100644
--- a/sys/src/cmd/acme/exec.c
+++ b/sys/src/cmd/acme/exec.c
@@ -297,10 +297,14 @@ void
newcol(Text *et, Text*, Text*, int, int, Rune*, int)
{
Column *c;
+ Window *w;
c = rowadd(et->row, nil, -1);
- if(c)
- winsettag(coladd(c, nil, nil, -1));
+ if(c) {
+ w = coladd(c, nil, nil, -1);
+ winsettag(w);
+ xfidlog(w, "new");
+ }
}
void
@@ -496,6 +500,7 @@ zeroxx(Text *et, Text *t, Text*, int, int, Rune*, int)
nw = coladd(t->w->col, nil, t->w, -1);
/* ugly: fix locks so w->unlock works */
winlock1(nw, t->w->owner);
+ xfidlog(nw, "zerox");
}
if(locked)
winunlock(t->w);
@@ -559,6 +564,7 @@ get(Text *et, Text *t, Text *argt, int flag1, int, Rune *arg, int narg)
textsetselect(&u->w->tag, u->w->tag.file->nc, u->w->tag.file->nc);
textscrdraw(u);
}
+ xfidlog(w, "get");
}
void
@@ -695,6 +701,7 @@ put(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
}
namer = bytetorune(name, &nname);
putfile(f, 0, f->nc, namer, nname);
+ xfidlog(w, "put");
free(name);
}