Charles.Forsyth20070608-1402fa5d71119 years agoHistory
408 lines · 9.3 KB · Text
RawDownload
.TH ACME 4.SH NAMEacme \- control files for text windows.SH SYNOPSIS.B acme[.B -f.I varfont] [.B -F.I fixfont][.I file\&... ].SH DESCRIPTIONThe text window system.IR acme (1)serves a variety of files for reading, writing, and controllingwindows.Some of them are virtual versions of system files for dealingwith the virtual console; others control operationsof .I acmeitself.When a command is run under.IR acme ,a directory holding these files is mounted on.B /mnt/acme(also bound to.BR /chan )and also.BR /dev/acme ;the files mentioned hereappear in both these directories..PPSome of these files supply virtual versions of services available from the underlyingenvironment, in particular the character terminal files.IR cons (3).Other files are unique to.IR acme ..TP.B acmeis a subdirectory used by.B win(see.IR acme (1))as a mount point for the.I acmefiles associated with the window in which.B winis running.It has no specific function under.I acmeitself..TP.B consis the standard and diagnostic output file for all commandsrun under.IR acme .(Input for commands is redirected to.BR /dev/null .)Text written to.B consappears in a window labelled.IB dir /+Errors\f1,where.I diris the directory in which the commandwas run.The window is created if necessary, but not until text is actually written..TP.B consctlIs an empty unwritable file present only for compatibility..TP.B indexholds a sequence of lines of text, one per window.  Each line has 5 decimal numbers,each formatted in 11 characters plus a blank\(emthe window ID;number of characters (runes) in the tag;number of characters in the body;a 1 if the window is a directory, 0 otherwise;and a 1 if the window is modified, 0otherwise\(emfollowed by the tag up to a newline if present.Thus at character position 5×12 starts the name of the window.If a file has multiple zeroxed windows open,only the most recently used will appear in the.B indexfile..TP.B labelis an empty file, writable without effect, present only for compatibility..TP.B newA directory analogous to the numbered directories.RI ( q.v. ).Accessing anyfile in.B newcreates a new window.  Thus to cause text to appear in a new window,write it to.BR /dev/new/body .For more control, open.BR /dev/new/ctland use the interface described below..LP.PPEach.I acmewindow has associated a directory numbered by its ID.Window IDs are chosen sequentially and may be discovered by the.B IDcommand, byreading the.B ctlfile, orindirectly through the.B indexfile.  The files in the numbered directories are as follows..TP.B addrmay be written with any textual address (line number, regular expression, etc.),in the format understood by button 3 but without the initial colon, including compound addresses,to set the address for text accessed through the.B datafile.When read, it returns the value of the address that would next be reador written through the.B datafile, in the format.BI # m ,# nwhere.I mand.I nare character (not byte) offsets.  If.I mand.I nare identical, the format is just.BI # m\f1.Thus a regular expression may be evaluated by writing it to.B addrand reading it back.The.B addraddress has no effect on the user's selection of text..TP.B bodyholds contents of the window body.  It may be read at any byte offset.Text written to.B bodyis always appended; the file offset is ignored..TP.B ctlmay be read to recover the five numbers as held in the.B indexfile, described above, plus three more fields: the width of thewindow in pixels, the name of the font used in the window,and the width of a tab character in pixels.Text messages may be written to.B ctlto affect the window.Each message is terminated by a newline and multiplemessages may be sent in a single write..RS .5i.TF "dumpdir\ directory".TP.B addr=dotSet the.B addraddress to that of the user's selected text in the window..TP.B cleanMark the window clean as though it has just been written..TP.B cleartagRemove all text in the tag after the vertical bar..TP.B delEquivalent to the.B Delinteractive command..TP.B deleteEquivalent to the.B Deleteinteractive command..TP.B dot=addrSet the user's selected text in the window to the text addressed by the.B addraddress..TP.BI dump " commandSet the command string to recreate the window from a dump file..TP.BI dumpdir " directorySet the directory in which to run the command to recreate the window from a dump file..TP.B getEquivalent to the.B Getinteractive command with no arguments; accepts no arguments..TP.B limit=addrWhen the.B ctlfile is first opened, regular expression context searches in.B addraddresses examine the whole file; this message restricts subsequentsearches to the current.B addraddress..TP.B markCancel.BR nomark ,returning the window to the usual state wherein each modification to thebody must be undone individually..TP.BI name " nameSet the name of the window to.IR name ..TP.B nomarkTurn off automatic `marking' of changes, so a set of related changesmay be undone in a single.B Undointeractive command..TP.B noscrollTurn off automatic `scrolling' of the window to show text written to the body..TP.B putEquivalent to the.B Putinteractive command with no arguments; accepts no arguments..TP.B scrollCancel a.B noscrollmessage, returning the window to the default state wherein each writeto the.B bodyfile causes the window to `scroll' to display the new text..TP.B showGuarantee at least some of the selected text is visible on the display..TP.B noechoStop echoing characters sent to the window but indicate their presence byprinting an asterisk..TP.B echoTurns.BR noechooff..RE.PD.TP.B datais used in conjunction with.B addrfor random access to the contents of the body.The file offset is ignored when writing the.B bodyfile, but the character (not byte) offset may be set with.B addrand then read from the.B datafile.Text, which must contain only whole characters (no `partial runes'),written to.B datareplaces the characters addressed by the.B addrfile and sets the address to the null string at the end of the written text.A read from.B datareturns as many whole characters as the read count will permit startingat the beginning of the.B addraddress (the end of the address has no effect)and sets the address to the null string at the end of the returnedcharacters..TP.B eventWhen a window's.B eventfile is open, changes to the window occur as always but theactions are also reported asmessages to the reader of the file.  Also, user actions with buttons 2 and 3(other than chorded.B Cutand.BR Paste ,which behave normally) have no immediate effect on the window;it is expected that the program reading the.B eventfile will interpret them.The messages have a fixed format:a character indicating the origin or cause of the action,a character indicating the type of the action,four free-format blank-terminated decimal numbers,optional text, and a newline.The first and second numbers are the character addresses of the action,the third is a flag,and the final is a count of the characters in the optional text, whichmay itself contain newlines.The origin characters are.B Efor writes to the.B bodyor.B tagfile,.B Ffor actions through the window's other files,.B Kfor the keyboard, and.B Mfor the mouse.The type characters are.B Dfor text deleted from the body,.B dfor text deleted from the tag,.B Ifor text inserted to the body,.B ifor text inserted to the tag,.B Lfor a button 3 action in the body,.B lfor a button 3 action in the tag,.B Xfor a button 2 action in the body, and.B xfor a button 2 action in the tag..IPIf the relevant text has less than 256 characters, it is included in the message;otherwise it is elided, the fourth number is 0, and the program must readit from the.B datafile if needed.  No text is sent on a.B Dor.B dmessage..IPFor.BR D ,.BR d ,.BR I ,and.BR ithe flag is always zero.For.BR Xand.BR x ,the flag is a bitwise OR (reported decimally) of the following:1 if the text indicated is recognized as an.I acmebuilt-in command;2 if the text indicated is a null string that has a non-null expansion;if so, another complete message will follow describing the expansionexactly as if it had been indicated explicitly (its flag will always be 0);8 if the command has an extra (chorded) argument; if so,two more complete messages will follow reporting the argument (withall numbers 0 except the character count) and where it originated, in the form ofa fully-qualified button 3 style address..IPFor.B Land.BR l ,the flag is the bitwise OR of the following:1 if.I acmecan interpret the action without loading a new file;2 if a second (post-expansion) message follows, analogous to that with.B Xmessages;4 if the text is a file or window name (perhaps with address) rather thanplain literal text..IPFor messages with the 1 bit on in the flag,writing the message back to the.B eventfile, but with the flag, count, and text omitted,will cause the action to be applied to the file exactly as it wouldhave been if the.B eventfile had not been open..TP.B tagholds contents of the window tag.  It may be read at any byte offset.Text written to.B tagis always appended; the file offset is ignored..SH SOURCE.B /appl/acme.br.B /appl/acme/acme.SH SEE ALSO.IR acme (1),.IR cons (3)