Keeping track of many concurrent acme invocations in rio can be annoying. While you can B2 'Local echo -n some_label > /dev/label' in a running acme, there's no way to set the label on an acme window when starting it from the command line or a script. This patch adds a -L option that takes as its argument a label name for the running acme. The label is valid only for the duration of the acme run, preserving the parent rio window's label when acme terminates. Reference: /n/sources/patch/maybe/acme-label Date: Tue Oct 27 22:14:10 CET 2009 Signed-off-by: lyndon@orthanc.ca --- /sys/src/cmd/acme/acme.c Tue Oct 27 22:06:57 2009 +++ /sys/src/cmd/acme/acme.c Tue Oct 27 22:06:54 2009 @@ -57,10 +57,10 @@ threadmain(int argc, char *argv[]) { int i; - char *p, *loadfile; + char *p, *label, *loadfile; char buf[256]; Column *c; - int ncol; + int labelfd, ncol; Display *d; static void *arg[1]; @@ -68,6 +68,7 @@ ncol = -1; + label = nil; loadfile = nil; ARGBEGIN{ case 'a': @@ -99,9 +100,14 @@ if(loadfile == nil) goto Usage; break; + case 'L': + label = ARGF(); + if(label == nil) + goto Usage; + break; default: Usage: - fprint(2, "usage: acme [-ab] [-c ncol] [-f font] [-F fixedfont] [-l loadfile | file...]\n"); + fprint(2, "usage: acme [-ab] [-c ncol] [-f font] [-F fixedfont] [-L label] [-l loadfile | file...]\n"); exits("usage"); }ARGEND @@ -184,6 +190,11 @@ plumbsendfd = plumbopen("send", OWRITE|OCEXEC); fsysinit(); + if(label){ + labelfd = open("/dev/label", ORDWR); + write(labelfd, label, strlen(label)); + close(labelfd); + } #define WPERCOL 8 disk = diskinit(); --- /sys/man/1/acme Tue Oct 27 22:07:03 2009 +++ /sys/man/1/acme Tue Oct 27 22:06:59 2009 @@ -19,6 +19,10 @@ .I fixfont ] [ +.B -L +.I label +] +[ .B -l .I loadfile | @@ -76,6 +80,11 @@ Tab intervals are set to the width of 4 (or the value of .BR $tabstop ) numeral zeros in the appropriate font. +.PP +The +.B -L +option sets the label of the acme window for the duration of +its run. .PP .SS Windows .I Acme