win [ command ]
Any named files are read into acme windows before acme accepts input. With the -l option, the state of the entire system is loaded from file, which should have been created by a Dump command (q.v.), and subsequent file names are ignored. Plain files display as text; directories display as columnated lists of the names of their components with the names of subdirectories having a slash appended.
The -f (-F) option sets the default variable-pitch (fixed-pitch) font; the default is /fonts/lucidasans/euro.8.font (.../lucm/unicode.9.font). Tab intervals are set to the width of 4 numeral zeros in the variable-pitch font.
If a window holds a directory, the name (first word of the tag) will end with a slash.
Tags exist at the top of each column and across the whole display. Acme pre-loads them with useful commands. Also, the tag across the top maintains a list of executing long-running commands.
Most text, including the names of windows, may be edited uniformly. The only exception is that the command names to the left of the bar in a tag are maintained automatically; changes to them are repaired by acme.
Button 1 is also useful for matching symbols. For example to match curly brackets in some limbo source, 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 match is made if the double click is performed immediately before the end bracket. In all, acme will 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.
Some commands, all by convention starting with a capital letter, are built-ins that are executed directly by acme:
A common place to store text for commands is in the tag; in fact acme maintains a set of commands appropriate to the state of the window to the left of the bar in the tag.
If the text indicated with button 2 is not a recognized built-in, it is executed as a shell command. For example, indicating date with button 2 runs date(1). The standard and error outputs of commands are sent to the error window associated with the directory from which the command was run, which will be created if necessary. For example, in a window /module/sys.m executing pwd will produce the output /module in a (possibly newly-created) window labelled /adm/+Errors; in a window containing /appl/cmd/date.b executing limbo date.b will run limbo(1) in /appl/cmd, producing output in a window labelled /appl/cmd/+Errors.
If the text names an existing window, acme moves the mouse cursor to the selected text in the body of that window. If the text names an existing file with no associated window, acme loads the file into a new window and moves the mouse there. If the text is a file name contained in double quotes, acme loads the indicated include file from the directory appropriate to the suffix of the file name of the window holding the text. (The Incl command adds directories to the standard list.)
If the text begins with a colon, it is taken to be an address within the body of the window containing the text. The address is evaluated, the resulting text highlighted, and the mouse moved to it. Thus, in acme, one must type :/regexp or :127 not just /regexp or 127. (There is an easier way to locate literal text; see below.)
If the text is a file name followed by a colon and an address, acme loads the file and evaluates the address. For example, clicking button 3 anywhere in the text file.c:27 will open file.c, select line 27, and put the mouse at the beginning of the line. The rules about Error files, directories, and so on all combine to make this an efficient way to investigate errors from compilers, etc.
If the text is not an address or file, it is taken to be literal text, which is then searched for in the body of the window in which button 3 was clicked. If a match is found, it is selected and the mouse is moved 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 the selection as the button 3 action, subsequent clicks will find subsequent occurrences without moving the mouse.
In all these actions, the mouse motion is not done if the text is a null string within a non-null selected string in the tag, so that (for example) complex regular expressions may be selected and applied repeatedly to the body by just clicking button 3 over them.
Thus to copy a word a number of times, double click on the word with button 1 to highlight it leaving button 1 down, press and release button 2 to cut it and save it in the snarf buffer, press and release button 3 to paste it back and then release button 1. Now move the cursor to any selected place in the text, press button 1 down, then button 3 and the word is copied in.
Similarly lines may be deleted by double clicking at the beginning or end of the line and then pressing button 2 with button 1 still down.
Commands may be given extra arguments by a mouse chord with buttons 2 and 1. While holding down button 2 on text to be executed as a command, clicking button 1 appends the text last pointed to by button 1 as a distinct final argument. For example, to search for literal text one may execute Look text with button 2 or instead point at text with button 1 in any window, release button 1, then execute Look, clicking button 1 while 2 is held down.
When an external command (e.g. echo(1)) is executed this way, the extra argument is passed as expected and an environment variable $acmeaddr is created that holds, in the form interpreted by button 3, the fully-qualified address of the extra argument.
Similarly winm creates a new window but runs the shell /dis/mash.dis by default. adiff behaves as diff in finding the difference between two files but the listing uses filename:linenumber format to allow the user to simply click on this to be sent to that line in the file. agrep does for grep what adiff does for diff above. cd changes directory but when used in a win window for example, sends information to the window to display a new heading reflecting the new directory.
The former expects the user's mail box to be in the directory and file specified as its first argument, the latter uses the POP3 protocol to connect to a server for the user's mail and will prompt for a password when first run. Otherwise their behaviour is the same.
Whenever a command is executed by acme, the default search path includes the directory of the window containing the command. Also, acme binds the directory /acme/dis in front of /dis when it starts; this is where acme-specific programs such as win reside.
The operators + and - are high precedence, while , and ; are low precedence.
In both + and - forms, if a2 is a line or character address with a missing number, the number defaults to 1. If a1 is missing, . is substituted. If both a1 and a2 are present and distinguishable, + may be elided. a2 may be a regular expression; if it is delimited by ?'s, the effect of the + or - is reversed.
It is an error for a compound address to represent a malformed substring. Some useful idioms: a1+- (a1-+) selects the line containing the end (beginning) of a1. 0/regexp/ locates the first match of the expression in the file. (The form 0;// sets dot unnecessarily.) ./regexp/// finds the second following occurrence of the expression, and .,/regexp/ extends dot.
Most commands may be prefixed by an address to indicate their range
of operation.
Those that may not are marked with a
*
below.
If a command takes
an address and none is supplied, dot is used.
The sole exception is
the
w
command, which defaults to
0,$.
In the description, `range' is used
to represent whatever address is supplied.
Many commands set the
value of dot as a side effect.
If so, it is always set to the `result'
of the change: the empty string for a deletion, the new text for an
insertion, etc. (but see the
s
and
e
commands).
If the file name is absent from any of these, the current file name is used. e always sets the file name; r and w do so if the file has no name.
In any of <, >, or |, if the command is omitted the last command (of any type) is substituted.
These may be nested arbitrarily deeply, but only one instance of either X or Y may appear in a %single command. An empty command in an x or y defaults to p; an empty command in X or Y defaults to f. g and v do not have defaults.
When a command makes a number of changes to a file, as in x/re/c/text/, the addresses of all changes to the file are computed in the original file. If the changes are in sequence, they are applied to the file. Successive insertions at the same address are catenated into a single insertion composed of the several insertions in the order applied.
ACME(1 ) | Rev: Thu Feb 15 14:42:47 GMT 2007 |