add errors file
diff --git a/man/man4/acme.4 b/man/man4/acme.4 index 40143a4..1312904 100644 --- a/man/man4/acme.4 +++ b/man/man4/acme.4
@@ -280,6 +280,17 @@ and sets the address to the null string at the end of the returned characters. .TP +.B errors +Writing to the +.B errors +file appends to the body of the +.IB dir /+Errors +window, where +.I dir +is the directory currently named in the tag. +The window is created if necessary, +but not until text is actually written. +.TP .B event When a window's .B event @@ -395,6 +406,13 @@ Text written to .B tag is always appended; the file offset is ignored. +.TP +.B xdata +The +.B xdata +file like +.B data +except that reads stop at the end address. .SH SOURCE .B \*9/src/cmd/acme .SH SEE ALSO
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h index 4ac0d67..19229e7 100644 --- a/src/cmd/acme/dat.h +++ b/src/cmd/acme/dat.h
@@ -15,6 +15,7 @@ QWctl, QWdata, QWeditout, + QWerrors, QWevent, QWrdsel, QWwrsel,
diff --git a/src/cmd/acme/fns.h b/src/cmd/acme/fns.h index c61f96e..74a381e 100644 --- a/src/cmd/acme/fns.h +++ b/src/cmd/acme/fns.h
@@ -28,6 +28,7 @@ uint loadfile(int, uint, int*, int(*)(void*, uint, Rune*, int), void*); Window* errorwin(Mntdir*, int); +Window* errorwinforwin(Window*); Runestr cleanrname(Runestr); void run(Window*, char*, Rune*, int, int, char*, char*, int); void fsysclose(void);
diff --git a/src/cmd/acme/fsys.c b/src/cmd/acme/fsys.c index 536a333..3123608 100644 --- a/src/cmd/acme/fsys.c +++ b/src/cmd/acme/fsys.c
@@ -83,6 +83,7 @@ { "ctl", QTFILE, QWctl, 0600 }, { "data", QTFILE, QWdata, 0600 }, { "editout", QTFILE, QWeditout, 0200 }, + { "errors", QTFILE, QWerrors, 0200 }, { "event", QTFILE, QWevent, 0600 }, { "rdsel", QTFILE, QWrdsel, 0400 }, { "wrsel", QTFILE, QWwrsel, 0200 },
diff --git a/src/cmd/acme/util.c b/src/cmd/acme/util.c index f9387df..c224cce 100644 --- a/src/cmd/acme/util.c +++ b/src/cmd/acme/util.c
@@ -129,6 +129,49 @@ return w; } +/* + * Incoming window should be locked. + * It will be unlocked and returned window + * will be locked in its place. + */ +Window* +errorwinforwin(Window *w) +{ + int i, n, nincl, owner; + Rune **incl; + Runestr dir; + Text *t; + + t = &w->body; + dir = dirname(t, nil, 0); + if(dir.nr==1 && dir.r[0]=='.'){ /* sigh */ + free(dir.r); + dir.r = nil; + dir.nr = 0; + } + incl = nil; + nincl = w->nincl; + if(nincl > 0){ + incl = emalloc(nincl*sizeof(Rune*)); + for(i=0; i<nincl; i++){ + n = runestrlen(w->incl[i]); + incl[i] = runemalloc(n+1); + runemove(incl[i], w->incl[i], n); + } + } + owner = w->owner; + winunlock(w); + for(;;){ + w = errorwin1(dir.r, dir.nr, incl, nincl); + winlock(w, owner); + if(w->col != nil) + break; + /* window deleted too fast */ + winunlock(w); + } + return w; +} + typedef struct Warning Warning; struct Warning{
diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c index 579f194..126a5fe 100644 --- a/src/cmd/acme/xfid.c +++ b/src/cmd/acme/xfid.c
@@ -444,6 +444,11 @@ respond(x, &fc, nil); break; + case QWerrors: + w = errorwinforwin(w); + t = &w->body; + goto BodyTag; + case QWbody: case QWwrsel: t = &w->body;