aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/exec.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2014-04-30 12:14:29 -0400
committerRuss Cox <rsc@swtch.com>2014-04-30 12:14:29 -0400
commit4a3fb87264f8bc03fc62f00ef335056f30d18023 (patch)
tree77d52013a1fbb6fd967c1e146d5ddbf5ca0c065d /src/cmd/acme/exec.c
parent833216fef8b946895956737d205bcad7031bf06f (diff)
downloadplan9port-4a3fb87264f8bc03fc62f00ef335056f30d18023.tar.gz
plan9port-4a3fb87264f8bc03fc62f00ef335056f30d18023.tar.bz2
plan9port-4a3fb87264f8bc03fc62f00ef335056f30d18023.zip
acme: add log file in acme root directory
Reading /mnt/acme/log reports a log of window create, put, 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. TBR=r R=r https://codereview.appspot.com/89560044
Diffstat (limited to 'src/cmd/acme/exec.c')
-rw-r--r--src/cmd/acme/exec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index 6f8bf3f6..6fe423a6 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -347,6 +347,7 @@ void
newcol(Text *et, Text *_0, Text *_1, int _2, int _3, Rune *_4, int _5)
{
Column *c;
+ Window *w;
USED(_0);
USED(_1);
@@ -356,8 +357,11 @@ newcol(Text *et, Text *_0, Text *_1, int _2, int _3, Rune *_4, int _5)
USED(_5);
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
@@ -562,6 +566,7 @@ zeroxx(Text *et, Text *t, Text *_1, int _2, int _3, Rune *_4, int _5)
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);
@@ -627,6 +632,7 @@ get(Text *et, Text *t, Text *argt, int flag1, int _0, Rune *arg, int narg)
textsetselect(&u->w->tag, u->w->tag.file->b.nc, u->w->tag.file->b.nc);
textscrdraw(u);
}
+ xfidlog(w, "get");
}
void
@@ -782,6 +788,7 @@ put(Text *et, Text *_0, Text *argt, int _1, int _2, Rune *arg, int narg)
}
namer = bytetorune(name, &nname);
putfile(f, 0, f->b.nc, namer, nname);
+ xfidlog(w, "put");
free(name);
}