Blob


1 .TH ACME 1
2 .SH NAME
3 acme, win, awd \- interactive text windows
4 .SH SYNOPSIS
5 .B acme
6 [
7 .B -f
8 .I varfont
9 ]
10 [
11 .B -F
12 .I fixfont
13 ]
14 [
15 .B -c
16 .I ncol
17 ]
18 [
19 .B -b
20 ]
21 [
22 .B -l
23 .I file
24 |
25 .I file
26 \&... ]
27 .LP
28 .B win
29 [
30 .I command
31 ]
32 .LP
33 .B awd
34 [
35 .I label
36 ]
37 .SH DESCRIPTION
38 .I Acme
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
42 .IR acme ;
43 these are discussed in
44 .IR acme (4).
45 .PP
46 Any named
47 .I files
48 are read into
49 .I acme
50 windows before
51 .I acme
52 accepts input.
53 With the
54 .B -l
55 option, the state of the entire system is loaded
56 from
57 .IR file ,
58 which should have been created by a
59 .B Dump
60 command (q.v.),
61 and subsequent
62 .I file
63 names are ignored.
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.
68 .PP
69 The
70 .B -f
71 .RB ( -F )
72 option sets the main font, usually variable-pitch (alternate, usually fixed-pitch);
73 the default is
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
77 .BR $tabstop )
78 numeral zeros in the appropriate font.
79 .PP
80 .SS Windows
81 .I Acme
82 windows are in two parts: a one-line
83 .I tag
84 above a multi-line
85 .IR body .
86 The body typically contains an image of a file, as in
87 .IR sam (1),
88 or the output of a
89 program, as in an
90 .IR rio (1)
91 window.
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
100 window.
101 .PP
102 If a window holds a directory, the name (first word of the tag) will end with
103 a slash.
104 .SS Scrolling
105 Each window has a scroll bar to the left of the body.
106 The scroll bar behaves much as in
107 .IR sam (1)
108 or
109 .IR rio (1)
110 except that scrolling occurs when the button is pressed, rather than released,
111 and continues
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.
116 .SS Layout
117 .I Acme
118 windows are arranged in columns. By default, it creates two columns when starting;
119 this can be overridden with the
120 .B -c
121 option.
122 Placement is automatic but may be adjusted
123 using the
124 .I layout box
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.
128 For windows, just
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.
133 (They will return
134 .I en masse
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':
138 .I Acme
139 believes it is modified from its original
140 contents.
141 .PP
142 Tags exist at the top of each column and across the whole display.
143 .I Acme
144 pre-loads them with useful commands.
145 Also, the tag across the top maintains a list of executing long-running commands.
146 .SS Typing
147 The behavior of typed text is similar to that in
148 .IR rio (1)
149 except that the characters are delivered to the tag or body under the mouse; there is no
150 `click to type'.
151 (The experimental option
152 .B -b
153 causes typing to go to the most recently clicked-at or made window.)
154 The usual backspacing conventions apply.
155 As in
156 .IR sam (1)
157 but not
158 .IR rio ,
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
162 to a
163 .B Cut
164 command
165 .RI ( q.v. ).
166 .PP
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
170 by
171 .IR acme .
172 .SS "Directory context
173 Each window's tag names a directory: explicitly if the window
174 holds a directory; implicitly if it holds a regular file
175 (e.g. the directory
176 .B /adm
177 if the window holds
178 .BR /adm/users ).
179 This directory provides a
180 .I context
181 for interpreting file names in that window.
182 For example, the string
183 .B users
184 in a window labeled
185 .B /adm/
186 or
187 .B /adm/keys
188 will be interpreted as the file name
189 .BR /adm/users .
190 The directory is defined purely textually, so it can be a non-existent
191 directory or a real directory associated with a non-existent file
192 (e.g.
193 .BR /adm/not-a-file ).
194 File names beginning with a slash
195 are assumed to be absolute file names.
196 .SS Errors
197 Windows whose names begin with
198 .B -
199 or
200 .B +
201 conventionally hold diagnostics and other data
202 not directly associated with files.
203 A window labeled
204 .B +Errors
205 receives all diagnostics produced by
206 .I acme
207 itself.
208 Diagnostics from commands run by
209 .I acme
210 appear in a window named
211 .IB directory /+Errors
212 where
213 .I directory
214 is identified by the context of the command.
215 These error windows are created when needed.
216 .SS "Mouse button 1
217 Mouse button 1 selects text just as in
218 .IR sam (1)
219 or
220 .IR rio (1) ,
221 including the usual double-clicking conventions.
222 .SS "Mouse button 2
223 By an
224 action similar to selecting text with button 1,
225 button 2 indicates text to execute as a command.
226 If the indicated text has multiple white-space-separated words,
227 the first is the command name and the second and subsequent
228 are its arguments.
229 If button 2 is `clicked'\(emindicates a null string\(em\c
230 .I acme
231 .I expands
232 the indicated text to find a command to run:
233 if the click is within button-1-selected text,
234 .I acme
235 takes that selection as the command;
236 otherwise it takes the largest string of valid file name characters containing the click.
237 Valid file name characters are alphanumerics and
238 .B _
239 .B .
240 .B -
241 .B +
242 .BR / .
243 This behavior is similar to double-clicking with button 1 but,
244 because a null command is meaningless, only a single click is required.
245 .PP
246 Some commands, all by convention starting with a capital letter, are
247 .I built-ins
248 that are executed directly by
249 .IR acme :
250 .TP
251 .B Cut
252 Delete most recently selected text and place in snarf buffer.
253 .TP
254 .B Del
255 Delete window. If window is dirty, instead print a warning; a second
256 .B Del
257 will succeed.
258 .TP
259 .B Delcol
260 Delete column and all its windows, after checking that windows are not dirty.
261 .TP
262 .B Delete
263 Delete window without checking for dirtiness.
264 .TP
265 .B Dump
266 Write the state of
267 .I acme
268 to the file name, if specified, or
269 .B $home/acme.dump
270 by default.
271 .TP
272 .B Edit
273 Treat the argument as a text editing command in the style of
274 .IR sam (1).
275 The full
276 .B Sam
277 language is implemented except for the commands
278 .BR k ,
279 .BR n ,
280 .BR q ,
281 and
282 .BR ! .
283 The
284 .B =
285 command is slightly different: it includes the file name and
286 gives only the line address unless the command is explicitly
287 .BR =# .
288 The `current window' for the command is the body of the window in which the
289 .B Edit
290 command is executed.
291 Usually the
292 .B Edit
293 command would be typed in a tag; longer commands may be prepared in a
294 scratch window and executed, with
295 .B Edit
296 itself in the current window, using the 2-1 chord described below.
297 .TP
298 .B Exit
299 Exit
300 .I acme
301 after checking that windows are not dirty.
302 .TP
303 .B Font
304 With no arguments, change the font of the associated window from fixed-spaced to
305 proportional-spaced or
306 .I vice
307 .IR versa .
308 Given a file name argument, change the font of the window to that stored in the named file.
309 If the file name argument is prefixed by
310 .B var
311 .RB ( fix ),
312 also set the default proportional-spaced (fixed-spaced) font for future use to that font.
313 Other existing windows are unaffected.
314 .TP
315 .B Get
316 Load file into window, replacing previous contents (after checking for dirtiness as in
317 .BR Del ).
318 With no argument, use the existing file name of the window.
319 Given an argument, use that file but do not change the window's file name.
320 .TP
321 .B ID
322 Print window ID number
323 .RI ( q.v. ).
324 .TP
325 .B Incl
326 When opening `include' files
327 (those enclosed in
328 .BR <> )
329 with button 3,
330 .I acme
331 searches in directories
332 .B /$objtype/include
333 and
334 .BR /sys/include .
335 .B Incl
336 adds its arguments to a supplementary list of include directories, analogous to
337 the
338 .B -I
339 option to the compilers.
340 This list is per-window and is inherited when windows are created by actions in that window, so
341 .I Incl
342 is most usefully applied to a directory containing relevant source.
343 With no arguments,
344 .I Incl
345 prints the supplementary list.
346 This command is largely superseded by plumbing
347 (see
348 .IR plumb (7)).
349 .TP
350 .B Kill
351 Send a
352 .B kill
353 note to
354 .IR acme -initiated
355 commands named as arguments.
356 .TP
357 .B Local
358 In the Plan 9
359 .IR acme ,
360 this prefix causes a command to be run in
361 .IR acme 's own
362 file name space and environment variable group.
363 On Unix this is impossible.
364 .B Local
365 is recognized as a prefix, but has no effect on the command being executed.
366 .\" .TP
367 .\" .B Local
368 .\" When prefixed to a command
369 .\" run the
370 .\" command in the same file name space and environment variable group as
371 .\" .IR acme .
372 .\" The environment of the command
373 .\" is restricted but is sufficient to run
374 .\" .IR bind (1),
375 .\" .IR 9fs
376 .\" (see
377 .\" .IR srv (4)),
378 .\" .IR import (4),
379 .\" etc.,
380 .\" and to set environment variables such as
381 .\" .BR $objtype .
382 .TP
383 .B Load
384 Restore the state of
385 .I acme
386 from a file (default
387 .BR $home/acme.dump )
388 created by the
389 .B Dump
390 command.
391 .TP
392 .B Look
393 Search in body for occurrence of literal text indicated by the argument or,
394 if none is given, by the selected text in the body.
395 .TP
396 .B New
397 Make new window. With arguments, load the named files into windows.
398 .TP
399 .B Newcol
400 Make new column.
401 .TP
402 .B Paste
403 Replace most recently selected text with contents of snarf buffer.
404 .TP
405 .B Put
406 Write window to the named file.
407 With no argument, write to the file named in the tag of the window.
408 .TP
409 .B Putall
410 Write all dirty windows whose names indicate existing regular files.
411 .TP
412 .B Redo
413 Complement of
414 .BR Undo .
415 .TP
416 .B Send
417 Append selected text or snarf buffer to end of body; used mainly with
418 .IR win .
419 .TP
420 .B Snarf
421 Place selected text in snarf buffer.
422 .TP
423 .B Sort
424 Arrange the windows in the column from top to bottom in lexicographical
425 order based on their names.
426 .TP
427 .B Tab
428 Set the width of tab stops for this window to the value of the argument, in units of widths of the zero
429 character.
430 With no arguments, it prints the current value.
431 .TP
432 .B Undo
433 Undo last textual change or set of changes.
434 .TP
435 .B Zerox
436 Create a copy of the window containing most recently selected text.
437 .PP
438 A common place to store text for commands is in the tag; in fact
439 .I acme
440 maintains a set of commands appropriate to the state of the window
441 to the left of the bar in the tag.
442 .PP
443 If the text indicated with button 2 is not a recognized built-in, it is executed as
444 a shell command. For example, indicating
445 .B date
446 with button 2 runs
447 .IR date (1).
448 The standard
449 and error outputs of commands are sent to the error window associated with
450 the directory from which the command was run, which will be created if
451 necessary.
452 For example, in a window
453 .B /adm/users
454 executing
455 .B pwd
456 will produce the output
457 .B /adm
458 in a (possibly newly-created) window labeled
459 .BR /adm/+Errors ;
460 in a window containing
461 .B /usr/local/plan9/src/cmd/sam/sam.c
462 executing
463 .B mk
464 will run
465 .IR mk (1)
466 in
467 .BR /usr/local/plan9/src/cmd/sam ,
468 producing output in a window labeled
469 .BR /usr/local/plan9/src/cmd/sam/+Errors .
470 The environment of such commands contains the variable
471 .B $%
472 with value set to the filename of the window in which the command is run.
473 .SS "Mouse button 3
474 Pointing at text with button 3 instructs
475 .I acme
476 to locate or acquire the file, string, etc. described by the indicated text and
477 its context.
478 This description follows the actions taken when
479 button 3 is released after sweeping out some text.
480 In the description,
481 .I text
482 refers to the text of the original sweep or, if it was null, the result of
483 applying the same expansion rules that apply to button 2 actions.
484 .PP
485 If the text names an existing window,
486 .I acme
487 moves the mouse cursor to the selected text in the body of that window.
488 If the text names an existing file with no associated window,
489 .I acme
490 loads the file into a new window and moves the mouse there.
491 If the text is a file name contained in angle brackets,
492 .I acme
493 loads the indicated include file from the directory appropriate to the
494 suffix of the file name of the window holding the text.
495 (The
496 .B Incl
497 command adds directories to the standard list.)
498 .PP
499 If the text begins with a colon, it is taken to be an address, in
500 the style of
501 .IR sam (1),
502 within the body of the window containing the text.
503 The address is evaluated, the resulting text highlighted, and the mouse moved to it.
504 Thus, in
505 .IR acme ,
506 one must type
507 .B :/regexp
508 or
509 .B :127
510 not just
511 .B /regexp
512 or
513 .BR 127 .
514 (There is an easier way to locate literal text; see below.)
515 .PP
516 If the text is a file name followed by a colon and an address,
517 .I acme
518 loads the file and evaluates the address. For example, clicking button 3 anywhere
519 in the text
520 .B file.c:27
521 will open
522 .BR file.c ,
523 select line
524 27, and put the mouse at the beginning of the line. The rules about Error
525 files, directories, and so on all combine to make this an efficient way to
526 investigate errors from compilers, etc.
527 .PP
528 If the text is not an address or file, it is taken to
529 be literal text, which is then searched for in the body of the window
530 in which button 3 was clicked. If a match is found, it is selected and the mouse is
531 moved there. Thus, to search for occurrences of a word in a file,
532 just click button 3 on the word. Because of the rule of using the
533 selection as the button 3 action, subsequent clicks will find subsequent
534 occurrences without moving the mouse.
535 .PP
536 In all these actions, the mouse motion is not done if the text is a null string
537 within a non-null selected string in the tag, so that (for example) complex regular expressions
538 may be selected and applied repeatedly to the
539 body by just clicking button 3 over them.
540 .SS "Chords of mouse buttons
541 Several operations are bound to multiple-button actions.
542 After selecting text, with button 1 still down, pressing button 2
543 executes
544 .B Cut
545 and button 3 executes
546 .BR Paste .
547 After clicking one button, the other undoes
548 the first; thus (while holding down button 1) 2 followed by 3 is a
549 .B Snarf
550 that leaves the file undirtied;
551 3 followed by 2 is a no-op.
552 These actions also apply to text selected by double-clicking because
553 the double-click expansion is made when the second
554 click starts, not when it ends.
555 .PP
556 Commands may be given extra arguments by a mouse chord with buttons 2 and 1.
557 While holding down button 2 on text to be executed as a command, clicking button 1
558 appends the text last pointed to by button 1 as a distinct final argument.
559 For example, to search for literal
560 .B text
561 one may execute
562 .B Look text
563 with button 2 or instead point at
564 .B text
565 with button 1 in any window, release button 1,
566 then execute
567 .BR Look ,
568 clicking button 1 while 2 is held down.
569 .PP
570 When an external command (e.g.
571 .IR echo (1))
572 is executed this way, the extra argument is passed as expected and an
573 environment variable
574 .B $acmeaddr
575 is created that holds, in the form interpreted by button 3,
576 the fully-qualified address of the extra argument.
577 .SS "Support programs
578 .I Win
579 creates a new
580 .I acme
581 window and runs a
582 .I command
583 (default
584 .BR /bin/rc )
585 in it, turning the window into something analogous to an
586 .IR rio (1)
587 window.
588 Executing text in a
589 .I win
590 window with button
591 2 is similar to using
592 .BR Send .
593 .PP
594 .I Awd
595 loads the tag line of its window with the directory in which it's running, suffixed
596 .BI - label
597 (default
598 .BR rc );
599 it is
600 intended to be executed by a
601 .B cd
602 function for use in
603 .I win
604 windows. An example definition is
605 .EX
606 fn cd { builtin cd $1 && awd $sysname }
607 .EE
608 .SS "Applications and guide files
609 In the directory
610 .B /acme
611 live several subdirectories, each corresponding to a program or
612 set of related programs that employ
613 .I acme's
614 user interface.
615 Each subdirectory includes source, binaries, and a
616 .B readme
617 file for further information.
618 It also includes a
619 .BR guide ,
620 a text file holding sample commands to invoke the programs.
621 The idea is to find an example in the guide that best matches
622 the job at hand, edit it to suit, and execute it.
623 .PP
624 Whenever a command is executed by
625 .IR acme ,
626 the default search path includes the directory of the window containing
627 the command and its subdirectory
628 .BR $cputype .
629 The program directories in
630 .B /acme
631 contain appropriately labeled subdirectories of binaries,
632 so commands named
633 in the guide files will be found automatically when run.
634 Also,
635 .I acme
636 binds the directories
637 .B /acme/bin
638 and
639 .B /acme/bin/$cputype
640 to the end of
641 .B /bin
642 when it starts; this is where
643 .IR acme -specific
644 programs such as
645 .I win
646 and
647 .I awd
648 reside.
649 .SH FILES
650 .TF $home/acme.dump
651 .TP
652 .B $home/acme.dump
653 default file for
654 .B Dump
655 and
656 .BR Load ;
657 also where state is written if
658 .I acme
659 dies or is killed unexpectedly, e.g. by deleting its window.
660 .TP
661 .B /acme/*/guide
662 template files for applications
663 .TP
664 .B /acme/*/readme
665 informal documentation for applications
666 .TP
667 .B /acme/*/src
668 source for applications
669 .TP
670 .B /acme/*/mips
671 MIPS-specific binaries for applications
672 .SH SOURCE
673 .B /usr/local/plan9/src/cmd/acme
674 .br
675 .B /usr/local/plan9/src/cmd/9term/win.c
676 .br
677 .B /usr/local/plan9/bin/awd
678 .SH SEE ALSO
679 .IR acme (4)
680 .br
681 Rob Pike,
682 .I
683 Acme: A User Interface for Programmers.
684 .SH BUGS
685 With the
686 .B -l
687 option or
688 .B Load
689 command,
690 the recreation of windows under control of external programs
691 such as
692 .I win
693 is just to rerun the command; information may be lost.