Charles.Forsyth20060303-partialeea662d19 years agoHistory
1203 lines · 28.5 KB · Text
RawDownload
.TH ACME 1.SH NAMEacme, win \- interactive text windows.SH SYNOPSIS.B acme[.B -f.I varfont][.B -F.I fixfont][.B -c.I ncol][.B -b][.B -l.I file|.I file\&... ].LP.B win[.I command].SH DESCRIPTION.I Acmemanages windows of text that may be edited interactively or by external programs.The interactive interface uses the keyboard and mouse; external programsuse a set of files served by.IR acme ;these are discussed in.IR acme (4)..PPAny named.I filesare read into.I acmewindows before.I acmeaccepts input.With the.B -loption, the state of the entire system is loadedfrom.IR file ,which should have been created by a.B Dumpcommand (q.v.),and subsequent.I filenames are ignored.Plain files display as text; directories display as columnated lists of thenames of their components with the names of subdirectories having a slash appended..PPThe.B -f.RB ( -F )option sets the default variable-pitch (fixed-pitch)font; the default is.B /fonts/lucidasans/euro.8.font.RB ( \&.../lucm/unicode.9.font ).Tab intervals are set to the width of 4 numeral zeros in the variable-pitch font..PP.SS Windows.I Acmewindows are in two parts: a one-line.I tagabove a multi-line.IR body .The body typically contains an image of a file or the output of a program.The tag contains a number ofblank-separated words, followed by a vertical bar character, followed by anything.The first word is the name of the window, typically the name of the associatedfile or directory, and the other words are commands available in that window.Any text may be added after the bar; examples are strings to search for orcommands to execute in that window.Changes to the text left of the bar will be ignored,unless the result is to change the name of thewindow..PPIf a window holds a directory, the name (first word of the tag) will end witha slash..SS ScrollingEach window has a scroll bar to the left of the body.Scrolling occurs when the button is pressed, rather than released,and continuesas long as the mouse button is held down in the scroll bar.For example, to scroll slowly through a file,hold button 3 down near the top of the scroll bar.  Moving the mousedown the scroll bar speeds up the rate of scrolling. Scrolling backwards is performedsimilarly using button 1. Button 2 allows absolute movement within the text; clicking itat different heights within the scroll bar changes the focused text without intermediatescrolling..SS Layout.I Acmewindows are arranged in columns.  By default, it creates two columns when starting;this can be overridden with the.B -coption.Placement is automatic but may be adjustedusing the.I layout boxin the upper left corner of each window and column.Pressing and holding any mouse button in the box dragsthe associated window or column.For windows, justclicking in the layout box grows the window in place: button 1grows it a little, button 2 grows it as much as it can, still leaving all othertags in that column visible, and button 3 takes over the column completely,temporarily hiding other windows in the column.(They will return.I en masseif any of them needs attention.)The layout box in a window is normally white; when it is black in the center,it records that the file is `dirty':.I Acmebelieves it is modified from its originalcontents..PPTags exist at the top of each column and across the whole display..I Acmepre-loads them with useful commands.Also, the tag across the top maintains a list of executing long-running commands..SS TypingThe behaviour of typed text is as one would expectexcept that the characters are delivered to the tag or body under the mouse; there is no`click to type'.(The experimental option.B -bcauses typing to go to the most recently clicked-at or made window.)The usual backspacing conventions apply.The ESC key selects the text typed since the last mouse action,a feature particularly useful when executing commands.A side effect is that typing ESC with text already selected is identicalto a.B Cutcommand.RI ( q.v. )..PPMost text, including the names of windows, may be edited uniformly.The only exception is that the command names to theleft of the bar in a tag are maintained automatically; changes to them are repairedby.IR acme ..SS "Directory contextEach window's tag names a directory: explicitly if the windowholds a directory; implicitly if it holds a regular file(e.g. the directory.B /moduleif the window holds.BR /module/sys.m ).This directory provides a.I contextfor interpreting file names in that window.For example, the string.B sys.min a window labelled.B /module/or.B /module/draw.mwill be interpreted as the file name.BR /module/sys.m .The directory is defined purely textually, so it can be a non-existentdirectory or a real directory associated with a non-existent file(e.g..BR /module/not-a-file ).File names beginning with a slashare assumed to be absolute file names..SS ErrorsWindows whose names begin with.B -or.B +conventionally hold diagnostics and other datanot directly associated with files.A window labelled.B +Errorsreceives all diagnostics produced by.I acmeitself.Diagnostics from commands run by.I acmeappear in a window named.IB directory /+Errorswhere.I directoryis identified by the context of the command.These error windows are created when needed..SS "Mouse button 1Mouse button 1 selects text and double-clicking highlights the text for replacement text to betyped in. .PPButton 1 is also useful for matching symbols. For example to match curly brackets in some limbosource, double click button 1 immediately after the open curly bracket.The whole of the text up to any matching end curly bracket will be highlighted. A similar matchis made if the double click is performed immediately before the end bracket. In all,.I acmewill match the pairs { and }, [ and ], ( and ), < and >, « and », ' and ', " and ", ` and `.Also whole lines of text may be highlighted by double clicking at the beginning or end of the line..SS "Mouse button 2By anaction similar to selecting text with button 1,button 2 indicates text to execute as a command.If the indicated text has multiple white-space-separated words,the first is the command name and the second and subsequentare its arguments.If button 2 is `clicked'\(emindicates a null string\(em\c.I acme.I expandsthe indicated text to find a command to run:if the click is within button-1-selected text,.I acmetakes that selection as the command;otherwise it takes the largest string of valid file name characters containing the click.Valid file name characters are alphanumerics and.B _.B ..B -.B +.BR / .This behaviour is similar to double-clicking with button 1 but,because a null command is meaningless, only a single click is required..PPSome commands, all by convention starting with a capital letter, are.I built-insthat are executed directly by.IR acme :.TF "Lineno\ \ ".PD.TP.B CutDelete most recently selected text and place in snarf buffer..TP.B DelDelete window.  If window is dirty, instead print a warning; a second.B Delwill succeed..TP.B DelcolDelete column and all its windows, after checking that windows are not dirty..TP.B DeleteDelete window without checking for dirtiness..TP.B DumpWrite the state of.I acmeto the file name, if specified, or.B $home/acme.dumpby default..TP.B EditTreat the argument as a text editing command in the style of Plan9's.IR sam.The full.B Samlanguage is implemented except for the commands.BR k ,.BR n ,.BR q ,and.BR ! .The.B =command is slightly different: it includes the file name andgives only the line address unless the command is explicitly.BR =# .The `current window' for the command is the body of the window in which the.B Editcommand is executed.Usually the.B Editcommand would be typed in a tag; longer commands may be prepared in ascratch window and executed, with.B Edititself in the current window, using the 2-1 chord described below. See the latersection on editing for a full description of the commands available here..TP.B ExitExit.I acmeafter checking that windows are not dirty..TP.B FontWith no arguments, change the font of the associated window from fixed-spaced toproportional-spaced or.I vice versa\f1.Given a file name argument, change the font of the window to that stored in the named file.If the file name argument is prefixed by.B var.RB ( fix ),also set the default proportional-spaced (fixed-spaced) font for future use to that font.Other existing windows are unaffected..TP.B GetLoad file into window, replacing previous contents (after checking for dirtiness as in.BR Del ).With no argument, use the existing file name of the window.Given an argument, use that file but do not change the window's file name..TP.B IDPrint window ID number.RI ( q.v. )..TP.B InclWhen opening `include' files with button 3,.I acmesearches in the directories.B /moduleand.B /include ..B Incladds its arguments to a supplementary list of include directories, analogous tothe.B -Ioption to the compilers.This list is per-window and is inherited when windows are created by actions in that window, so.I Inclis most usefully applied to a directory containing relevant source.With no arguments,.I Inclprints the supplementary list..TP.B KillSend a.B killnote to.IR acme -initiatedcommands named as arguments..TP.B LinenoGive the line number(s) of the currently selected text..TP.B LoadRestore the state of.I acmefrom a file (default.BR $home/acme.dump )created by the.B Dumpcommand..TP.B LocalWhen prefixed to a commandrun thecommand in the same file name space and environment variable group as.IR acme .The environment of the commandis restricted but is sufficient to run.IR bind (1),.IR mount ,etc.,and to set environment variables..TP.B LookSearch in body for occurrence of literal text indicated by the argument or,if none is given, by the selected text in the body..TP.B NewMake new window.  With arguments, load the named files into windows..TP.B NewcolMake new column..TP.B PasteReplace most recently selected text with contents of snarf buffer..TP.B PutWrite window to the named file.With no argument, write to the file named in the tag of the window..TP.B PutallWrite all dirty windows whose names indicate existing regular files..TP.B RedoComplement of.BR Undo ..TP.B SendAppend selected text or snarf buffer to end of body; used mainly with.IR win ..TP.B SnarfPlace selected text in snarf buffer..TP.B SortArrange the windows in the column from top to bottom in lexicographicalorder based on their names..TP.B UndoUndo last textual change or set of changes..TP.B ZeroxCreate a copy of the window containing most recently selected text..PPA common place to store text for commands is in the tag; in fact.I acmemaintains a set of commands appropriate to the state of the windowto the left of the bar in the tag..PPIf the text indicated with button 2 is not a recognized built-in, it is executed asa shell command.  For example, indicating.B datewith button 2 runs.IR date (1).The standardand error outputs of commands are sent to the error window associated withthe directory from which the command was run, which will be created ifnecessary.For example, in a window.B /module/sys.mexecuting.B pwdwill produce the output.B /modulein a (possibly newly-created) window labelled.BR /adm/+Errors ;in a window containing.B /appl/cmd/date.bexecuting.B "limbo date.b"will run.IR limbo (1)in.BR /appl/cmd ,producing output in a window labelled.BR /appl/cmd/+Errors ..SS "Mouse button 3Pointing at text with button 3 instructs.I acmeto locate or acquire the file, string, etc. described by the indicated text andits context.This description follows the actions taken whenbutton 3 is released after sweeping out some text.In the description,.I textrefers to the text of the original sweep or, if it was null, the result ofapplying the same expansion rules that apply to button 2 actions..PPIf the text names an existing window,.I acmemoves the mouse cursor to the selected text in the body of that window.If the text names an existing file with no associated window,.I acmeloads the file into a new window and moves the mouse there.If the text is a file name contained in double quotes,.I acmeloads the indicated include file from the directory appropriate to thesuffix of the file name of the window holding the text.(The.B Inclcommand adds directories to the standard list.).PPIf the text begins with a colon, it is taken to be an addresswithin the body of the window containing the text.The address is evaluated, the resulting text highlighted, and the mouse moved to it.Thus, in.IR acme ,one must type.B :/regexpor.B :127not just.B /regexpor.BR 127 .(There is an easier way to locate literal text; see below.).PPIf the text is a file name followed by a colon and an address,.I acmeloads the file and evaluates the address.  For example, clicking button 3 anywherein the text.B file.c:27will open.BR file.c ,select line27, and put the mouse at the beginning of the line.  The rules about Errorfiles, directories, and so on all combine to make this an efficient way toinvestigate errors from compilers, etc..PPIf the text is not an address or file, it is taken tobe literal text, which is then searched for in the body of the windowin which button 3 was clicked.  If a match is found, it is selected and the mouse ismoved there.  Thus, to search for occurrences of a word in a file,just click button 3 on the word.  Because of the rule of using theselection as the button 3 action, subsequent clicks will find subsequentoccurrences without moving the mouse..PPIn all these actions, the mouse motion is not done if the text is a null stringwithin a non-null selected string in the tag, so that (for example) complex regular expressionsmay be selected and applied repeatedly to thebody by just clicking button 3 over them.

Lines 1–500 of 1203.