From 4a3fb87264f8bc03fc62f00ef335056f30d18023 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Apr 2014 12:14:29 -0400 Subject: 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 --- src/cmd/acme/look.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cmd/acme/look.c') diff --git a/src/cmd/acme/look.c b/src/cmd/acme/look.c index 8d136110..3c5765a8 100644 --- a/src/cmd/acme/look.c +++ b/src/cmd/acme/look.c @@ -298,6 +298,7 @@ plumbshow(Plumbmsg *m) winsettag(w); textscrdraw(&w->body); textsetselect(&w->tag, w->tag.file->b.nc, w->tag.file->b.nc); + xfidlog(w, "new"); } int @@ -770,6 +771,7 @@ openfile(Text *t, Expand *e) w->autoindent = ow->autoindent; }else w->autoindent = globalautoindent; + xfidlog(w, "new"); } if(e->a1 == e->a0) eval = FALSE; @@ -803,6 +805,7 @@ new(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg) int na, nf; Expand e; Runestr rs; + Window *w; getarg(argt, FALSE, TRUE, &a, &na); if(a){ @@ -814,8 +817,11 @@ new(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg) for(ndone=0; ; ndone++){ a = findbl(arg, narg, &na); if(a == arg){ - if(ndone==0 && et->col!=nil) - winsettag(coladd(et->col, nil, nil, -1)); + if(ndone==0 && et->col!=nil) { + w = coladd(et->col, nil, nil, -1); + winsettag(w); + xfidlog(w, "new"); + } break; } nf = narg-na; -- cgit v1.2.3