3 acme, win, awd \- interactive text windows
39 manages windows of text that may be edited interactively or by external programs.
40 The interactive interface uses the keyboard and mouse; external programs
41 use a set of files served by
43 these are discussed in
55 option, the state of the entire system is loaded
58 which should have been created by a
64 Plain files display as text; directories display as columnated lists of the
65 names of their components, as in
66 .B "ls -p directory|mc
67 except that the names of subdirectories have a slash appended.
72 option sets the main font, usually variable-pitch (alternate, usually fixed-pitch);
74 .B /lib/font/bit/lucidasans/euro.8.font
75 .RB ( \&.../lucm/unicode.9.font ).
76 Tab intervals are set to the width of 4 (or the value of
78 numeral zeros in the appropriate font.
82 windows are in two parts: a one-line
86 The body typically contains an image of a file, as in
92 The tag contains a number of
93 blank-separated words, followed by a vertical bar character, followed by anything.
94 The first word is the name of the window, typically the name of the associated
95 file or directory, and the other words are commands available in that window.
96 Any text may be added after the bar; examples are strings to search for or
97 commands to execute in that window.
98 Changes to the text left of the bar will be ignored,
99 unless the result is to change the name of the
102 If a window holds a directory, the name (first word of the tag) will end with
105 Each window has a scroll bar to the left of the body.
106 The scroll bar behaves much as in
110 except that scrolling occurs when the button is pressed, rather than released,
112 as long as the mouse button is held down in the scroll bar.
113 For example, to scroll slowly through a file,
114 hold button 3 down near the top of the scroll bar. Moving the mouse
115 down the scroll bar speeds up the rate of scrolling.
118 windows are arranged in columns. By default, it creates two columns when starting;
119 this can be overridden with the
122 Placement is automatic but may be adjusted
125 in the upper left corner of each window and column.
126 Pressing and holding any mouse button in the box drags
127 the associated window or column.
129 clicking in the layout box grows the window in place: button 1
130 grows it a little, button 2 grows it as much as it can, still leaving all other
131 tags in that column visible, and button 3 takes over the column completely,
132 temporarily hiding other windows in the column.
135 if any of them needs attention.)
136 The layout box in a window is normally white; when it is black in the center,
137 it records that the file is `dirty':
139 believes it is modified from its original
142 Tags exist at the top of each column and across the whole display.
144 pre-loads them with useful commands.
145 Also, the tag across the top maintains a list of executing long-running commands.
147 The behavior of typed text is similar to that in
149 except that the characters are delivered to the tag or body under the mouse; there is no
151 (The experimental option
153 causes typing to go to the most recently clicked-at or made window.)
154 The usual backspacing conventions apply.
159 the ESC key selects the text typed since the last mouse action,
160 a feature particularly useful when executing commands.
161 A side effect is that typing ESC with text already selected is identical
167 Most text, including the names of windows, may be edited uniformly.
168 The only exception is that the command names to the
169 left of the bar in a tag are maintained automatically; changes to them are repaired
173 When a window is in autoindent mode
176 command below) and a newline character is typed,
177 acme copies leading white space on the current line to the new line.
180 causes each window to start in
182 .SS "Directory context
183 Each window's tag names a directory: explicitly if the window
184 holds a directory; implicitly if it holds a regular file
189 This directory provides a
191 for interpreting file names in that window.
192 For example, the string
198 will be interpreted as the file name
200 The directory is defined purely textually, so it can be a non-existent
201 directory or a real directory associated with a non-existent file
203 .BR /adm/not-a-file ).
204 File names beginning with a slash
205 are assumed to be absolute file names.
207 Windows whose names begin with
211 conventionally hold diagnostics and other data
212 not directly associated with files.
215 receives all diagnostics produced by
218 Diagnostics from commands run by
220 appear in a window named
221 .IB directory /+Errors
224 is identified by the context of the command.
225 These error windows are created when needed.
227 Mouse button 1 selects text just as in
231 including the usual double-clicking conventions.
234 action similar to selecting text with button 1,
235 button 2 indicates text to execute as a command.
236 If the indicated text has multiple white-space-separated words,
237 the first is the command name and the second and subsequent
239 If button 2 is `clicked'\(emindicates a null string\(em\c
242 the indicated text to find a command to run:
243 if the click is within button-1-selected text,
245 takes that selection as the command;
246 otherwise it takes the largest string of valid file name characters containing the click.
247 Valid file name characters are alphanumerics and
253 This behavior is similar to double-clicking with button 1 but,
254 because a null command is meaningless, only a single click is required.
256 Some commands, all by convention starting with a capital letter, are
258 that are executed directly by
262 Delete most recently selected text and place in snarf buffer.
265 Delete window. If window is dirty, instead print a warning; a second
270 Delete column and all its windows, after checking that windows are not dirty.
273 Delete window without checking for dirtiness.
278 to the file name, if specified, or
283 Treat the argument as a text editing command in the style of
287 language is implemented except for the commands
295 command is slightly different: it includes the file name and
296 gives only the line address unless the command is explicitly
298 The `current window' for the command is the body of the window in which the
303 command would be typed in a tag; longer commands may be prepared in a
304 scratch window and executed, with
306 itself in the current window, using the 2-1 chord described below.
311 after checking that windows are not dirty.
314 With no arguments, change the font of the associated window from fixed-spaced to
315 proportional-spaced or
318 Given a file name argument, change the font of the window to that stored in the named file.
319 If the file name argument is prefixed by
322 also set the default proportional-spaced (fixed-spaced) font for future use to that font.
323 Other existing windows are unaffected.
326 Load file into window, replacing previous contents (after checking for dirtiness as in
328 With no argument, use the existing file name of the window.
329 Given an argument, use that file but do not change the window's file name.
332 Print window ID number
336 When opening `include' files
341 searches in directories
346 adds its arguments to a supplementary list of include directories, analogous to
349 option to the compilers.
350 This list is per-window and is inherited when windows are created by actions in that window, so
352 is most usefully applied to a directory containing relevant source.
355 prints the supplementary list.
356 This command is largely superseded by plumbing
361 Set the autoindent mode according to the argument:
365 set the mode for the current window;
369 set the mode for all existing and future windows.
376 commands named as arguments.
382 .BR $home/acme.dump )
388 When prefixed to a command
390 command in the same file name space and environment variable group as
392 The environment of the command
393 is restricted but is sufficient to run
400 and to set environment variables such as
404 Search in body for occurrence of literal text indicated by the argument or,
405 if none is given, by the selected text in the body.
408 Make new window. With arguments, load the named files into windows.
414 Replace most recently selected text with contents of snarf buffer.
417 Write window to the named file.
418 With no argument, write to the file named in the tag of the window.
421 Write all dirty windows whose names indicate existing regular files.
428 Append selected text or snarf buffer to end of body; used mainly with
432 Place selected text in snarf buffer.
435 Arrange the windows in the column from top to bottom in lexicographical
436 order based on their names.
439 Set the width of tab stops for this window to the value of the argument, in units of widths of the zero
441 With no arguments, it prints the current value.
444 Undo last textual change or set of changes.
447 Create a copy of the window containing most recently selected text.
450 If a regular shell command is preceded by a
455 character, the selected text in the body of the window is affected by the
456 I/O from the command.
459 character causes the selection to be replaced by the standard output
462 causes the selection to be sent as standard input to the command; and
464 does both at once, `piping' the selection through the command and
465 replacing it with the output.
467 A common place to store text for commands is in the tag; in fact
469 maintains a set of commands appropriate to the state of the window
470 to the left of the bar in the tag.
472 If the text indicated with button 2 is not a recognized built-in, it is executed as
473 a shell command. For example, indicating
478 and error outputs of commands are sent to the error window associated with
479 the directory from which the command was run, which will be created if
481 For example, in a window
485 will produce the output
487 in a (possibly newly-created) window labeled
489 in a window containing
490 .B /sys/src/cmd/sam/sam.c
496 .BR /sys/src/cmd/sam ,
497 producing output in a window labeled
498 .BR /sys/src/cmd/sam/+Errors .
499 The environment of such commands contains the variable
501 with value set to the filename of the window in which the command is run,
504 set to the window's id number
508 Pointing at text with button 3 instructs
510 to locate or acquire the file, string, etc. described by the indicated text and
512 This description follows the actions taken when
513 button 3 is released after sweeping out some text.
516 refers to the text of the original sweep or, if it was null, the result of
517 applying the same expansion rules that apply to button 2 actions.
519 If the text names an existing window,
521 moves the mouse cursor to the selected text in the body of that window.
522 If the text names an existing file with no associated window,
524 loads the file into a new window and moves the mouse there.
525 If the text is a file name contained in angle brackets,
527 loads the indicated include file from the directory appropriate to the
528 suffix of the file name of the window holding the text.
531 command adds directories to the standard list.)
533 If the text begins with a colon, it is taken to be an address, in
536 within the body of the window containing the text.
537 The address is evaluated, the resulting text highlighted, and the mouse moved to it.
548 (There is an easier way to locate literal text; see below.)
550 If the text is a file name followed by a colon and an address,
552 loads the file and evaluates the address. For example, clicking button 3 anywhere
558 27, and put the mouse at the beginning of the line. The rules about Error
559 files, directories, and so on all combine to make this an efficient way to
560 investigate errors from compilers, etc.
562 If the text is not an address or file, it is taken to
563 be literal text, which is then searched for in the body of the window
564 in which button 3 was clicked. If a match is found, it is selected and the mouse is
565 moved there. Thus, to search for occurrences of a word in a file,
566 just click button 3 on the word. Because of the rule of using the
567 selection as the button 3 action, subsequent clicks will find subsequent
568 occurrences without moving the mouse.
570 In all these actions, the mouse motion is not done if the text is a null string
571 within a non-null selected string in the tag, so that (for example) complex regular expressions
572 may be selected and applied repeatedly to the
573 body by just clicking button 3 over them.
574 .SS "Chords of mouse buttons
575 Several operations are bound to multiple-button actions.
576 After selecting text, with button 1 still down, pressing button 2
579 and button 3 executes
581 After clicking one button, the other undoes
582 the first; thus (while holding down button 1) 2 followed by 3 is a
584 that leaves the file undirtied;
585 3 followed by 2 is a no-op.
586 These actions also apply to text selected by double-clicking because
587 the double-click expansion is made when the second
588 click starts, not when it ends.
590 Commands may be given extra arguments by a mouse chord with buttons 2 and 1.
591 While holding down button 2 on text to be executed as a command, clicking button 1
592 appends the text last pointed to by button 1 as a distinct final argument.
593 For example, to search for literal
597 with button 2 or instead point at
599 with button 1 in any window, release button 1,
602 clicking button 1 while 2 is held down.
604 When an external command (e.g.
606 is executed this way, the extra argument is passed as expected and an
609 is created that holds, in the form interpreted by button 3,
610 the fully-qualified address of the extra argument.
611 .SS "Support programs
619 in it, turning the window into something analogous to an
625 2 is similar to using
629 loads the tag line of its window with the directory in which it's running, suffixed
634 intended to be executed by a
638 windows. An example definition is
640 fn cd { builtin cd $1 && awd $sysname }
642 .SS "Applications and guide files
645 live several subdirectories, each corresponding to a program or
646 set of related programs that employ
649 Each subdirectory includes source, binaries, and a
651 file for further information.
654 a text file holding sample commands to invoke the programs.
655 The idea is to find an example in the guide that best matches
656 the job at hand, edit it to suit, and execute it.
658 Whenever a command is executed by
660 the default search path includes the directory of the window containing
661 the command and its subdirectory
663 The program directories in
665 contain appropriately labeled subdirectories of binaries,
667 in the guide files will be found automatically when run.
670 binds the directories
673 .B /acme/bin/$cputype
676 when it starts; this is where
691 also where state is written if
693 dies or is killed unexpectedly, e.g. by deleting its window.
696 template files for applications
699 informal documentation for applications
702 source for applications
705 MIPS-specific binaries for applications
709 .B /acme/bin/source/win
711 .B /sys/src/cmd/awd.c
717 Acme: A User Interface for Programmers.
724 the recreation of windows under control of external programs
727 is just to rerun the command; information may be lost.