diff options
| author | Russ Cox <rsc@swtch.com> | 2014-04-30 12:14:29 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@swtch.com> | 2014-04-30 12:14:29 -0400 |
| commit | 4a3fb87264f8bc03fc62f00ef335056f30d18023 (patch) | |
| tree | 77d52013a1fbb6fd967c1e146d5ddbf5ca0c065d /src/cmd/acme/look.c | |
| parent | 833216fef8b946895956737d205bcad7031bf06f (diff) | |
| download | plan9port-4a3fb87264f8bc03fc62f00ef335056f30d18023.tar.gz 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/look.c')
| -rw-r--r-- | src/cmd/acme/look.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; |
