1 058b0118 2005-01-03 devnull .TH ACME 4
3 058b0118 2005-01-03 devnull acme \- control files for text windows
4 058b0118 2005-01-03 devnull .SH SYNOPSIS
8 058b0118 2005-01-03 devnull .I varfont
11 058b0118 2005-01-03 devnull .I fixfont
16 058b0118 2005-01-03 devnull .SH DESCRIPTION
17 058b0118 2005-01-03 devnull The text window system
18 058b0118 2005-01-03 devnull .IR acme (1)
19 058b0118 2005-01-03 devnull serves a variety of files for reading, writing, and controlling
21 058b0118 2005-01-03 devnull Some of them are virtual versions of system files for dealing
22 058b0118 2005-01-03 devnull with the virtual console; others control operations
26 058b0118 2005-01-03 devnull When a command is run under
27 058b0118 2005-01-03 devnull .IR acme ,
28 c8b6342d 2005-01-13 devnull a directory holding these files is posted as the 9P service
31 c8b6342d 2005-01-13 devnull .IR 9pserve (4)).
33 058b0118 2005-01-03 devnull Some of these files supply virtual versions of services available from the underlying
34 058b0118 2005-01-03 devnull environment, in particular the character terminal files in Plan 9's
35 058b0118 2005-01-03 devnull \fIcons\fR(3).
36 058b0118 2005-01-03 devnull (Unlike in Plan 9's \fIrio\fR(1),
37 058b0118 2005-01-03 devnull each command under
39 058b0118 2005-01-03 devnull sees the same set of files; there is not a distinct
40 058b0118 2005-01-03 devnull .B /dev/cons
41 058b0118 2005-01-03 devnull for each window.)
42 058b0118 2005-01-03 devnull Other files are unique to
43 058b0118 2005-01-03 devnull .IR acme .
46 058b0118 2005-01-03 devnull is a subdirectory used by
49 058b0118 2005-01-03 devnull .IR acme (1))
50 058b0118 2005-01-03 devnull as a mount point for the
52 058b0118 2005-01-03 devnull files associated with the window in which
54 058b0118 2005-01-03 devnull is running.
55 058b0118 2005-01-03 devnull It has no specific function under
60 058b0118 2005-01-03 devnull is the standard and diagnostic output file for all commands
61 058b0118 2005-01-03 devnull run under
62 058b0118 2005-01-03 devnull .IR acme .
63 058b0118 2005-01-03 devnull (Input for commands is redirected to
64 058b0118 2005-01-03 devnull .BR /dev/null .)
65 058b0118 2005-01-03 devnull Text written to
67 058b0118 2005-01-03 devnull appears in a window labeled
68 058b0118 2005-01-03 devnull .IB dir /+Errors\f1,
71 058b0118 2005-01-03 devnull is the directory in which the command
73 058b0118 2005-01-03 devnull The window is created if necessary, but not until text is actually written.
75 058b0118 2005-01-03 devnull .B consctl
76 058b0118 2005-01-03 devnull Is an empty unwritable file present only for compatibility; there is no way
77 058b0118 2005-01-03 devnull to turn off `echo', for example, under
78 058b0118 2005-01-03 devnull .IR acme .
81 058b0118 2005-01-03 devnull holds a sequence of lines of text, one per window. Each line has 5 decimal numbers,
82 058b0118 2005-01-03 devnull each formatted in 11 characters plus a blank\(emthe window ID;
83 058b0118 2005-01-03 devnull number of characters (runes) in the tag;
84 058b0118 2005-01-03 devnull number of characters in the body;
85 058b0118 2005-01-03 devnull a 1 if the window is a directory, 0 otherwise;
86 058b0118 2005-01-03 devnull and a 1 if the window is modified, 0
87 058b0118 2005-01-03 devnull otherwise\(emfollowed by the tag up to a newline if present.
88 058b0118 2005-01-03 devnull Thus at character position 5×12 starts the name of the window.
89 058b0118 2005-01-03 devnull If a file has multiple zeroxed windows open,
90 058b0118 2005-01-03 devnull only the most recently used will appear in the
95 058b0118 2005-01-03 devnull is an empty file, writable without effect, present only for compatibility with
96 058b0118 2005-01-03 devnull .BR rio .
99 058b0118 2005-01-03 devnull A directory analogous to the numbered directories
100 058b0118 2005-01-03 devnull .RI ( q.v. ).
101 058b0118 2005-01-03 devnull Accessing any
104 058b0118 2005-01-03 devnull creates a new window. Thus to cause text to appear in a new window,
105 058b0118 2005-01-03 devnull write it to
106 058b0118 2005-01-03 devnull .BR /dev/new/body .
107 058b0118 2005-01-03 devnull For more control, open
108 058b0118 2005-01-03 devnull .BR /dev/new/ctl
109 058b0118 2005-01-03 devnull and use the interface described below.
114 058b0118 2005-01-03 devnull window has associated a directory numbered by its ID.
115 058b0118 2005-01-03 devnull Window IDs are chosen sequentially and may be discovered by the
117 058b0118 2005-01-03 devnull command, by
118 058b0118 2005-01-03 devnull reading the
120 058b0118 2005-01-03 devnull file, or
121 058b0118 2005-01-03 devnull indirectly through the
122 058b0118 2005-01-03 devnull .B index
123 058b0118 2005-01-03 devnull file. The files in the numbered directories are as follows.
126 058b0118 2005-01-03 devnull may be written with any textual address (line number, regular expression, etc.),
127 058b0118 2005-01-03 devnull in the format understood by button 3 but without the initial colon, including compound addresses,
128 058b0118 2005-01-03 devnull to set the address for text accessed through the
131 058b0118 2005-01-03 devnull When read, it returns the value of the address that would next be read
132 058b0118 2005-01-03 devnull or written through the
134 058b0118 2005-01-03 devnull file, in the format
135 058b0118 2005-01-03 devnull .BI # m ,# n
140 058b0118 2005-01-03 devnull are character (not byte) offsets. If
144 058b0118 2005-01-03 devnull are identical, the format is just
145 058b0118 2005-01-03 devnull .BI # m\f1.
146 058b0118 2005-01-03 devnull Thus a regular expression may be evaluated by writing it to
148 058b0118 2005-01-03 devnull and reading it back.
151 058b0118 2005-01-03 devnull address has no effect on the user's selection of text.
154 058b0118 2005-01-03 devnull holds contents of the window body. It may be read at any byte offset.
155 058b0118 2005-01-03 devnull Text written to
157 058b0118 2005-01-03 devnull is always appended; the file offset is ignored.
160 058b0118 2005-01-03 devnull may be read to recover the five numbers as held in the
161 058b0118 2005-01-03 devnull .B index
162 058b0118 2005-01-03 devnull file, described above, plus two more fields: the width of the
163 058b0118 2005-01-03 devnull window in pixels and the name of the font used in the window.
164 058b0118 2005-01-03 devnull Text messages may be written to
166 058b0118 2005-01-03 devnull to affect the window.
167 058b0118 2005-01-03 devnull Each message is terminated by a newline and multiple
168 058b0118 2005-01-03 devnull messages may be sent in a single write.
170 058b0118 2005-01-03 devnull .TF limit=addr
172 058b0118 2005-01-03 devnull .B addr=dot
175 058b0118 2005-01-03 devnull address to that of the user's selected text in the window.
177 058b0118 2005-01-03 devnull .B clean
178 058b0118 2005-01-03 devnull Mark the window clean as though it has just been written.
180 058b0118 2005-01-03 devnull .B dirty
181 058b0118 2005-01-03 devnull Mark the window dirty, the opposite of clean.
183 058b0118 2005-01-03 devnull .B cleartag
184 058b0118 2005-01-03 devnull Remove all text in the tag after the vertical bar.
187 058b0118 2005-01-03 devnull Equivalent to the
189 058b0118 2005-01-03 devnull interactive command.
191 058b0118 2005-01-03 devnull .B delete
192 058b0118 2005-01-03 devnull Equivalent to the
193 058b0118 2005-01-03 devnull .B Delete
194 058b0118 2005-01-03 devnull interactive command.
196 058b0118 2005-01-03 devnull .B dot=addr
197 058b0118 2005-01-03 devnull Set the user's selected text in the window to the text addressed by the
199 058b0118 2005-01-03 devnull address.
201 058b0118 2005-01-03 devnull .BI dump " command
202 058b0118 2005-01-03 devnull Set the command string to recreate the window from a dump file.
204 058b0118 2005-01-03 devnull .BI dumpdir " directory
205 058b0118 2005-01-03 devnull Set the directory in which to run the command to recreate the window from a dump file.
208 058b0118 2005-01-03 devnull Equivalent to the
210 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
212 058b0118 2005-01-03 devnull .B limit=addr
213 058b0118 2005-01-03 devnull When the
215 058b0118 2005-01-03 devnull file is first opened, regular expression context searches in
217 058b0118 2005-01-03 devnull addresses examine the whole file; this message restricts subsequent
218 058b0118 2005-01-03 devnull searches to the current
220 058b0118 2005-01-03 devnull address.
224 058b0118 2005-01-03 devnull .BR nomark ,
225 058b0118 2005-01-03 devnull returning the window to the usual state wherein each modification to the
226 058b0118 2005-01-03 devnull body must be undone individually.
228 058b0118 2005-01-03 devnull .BI name " name
229 058b0118 2005-01-03 devnull Set the name of the window to
230 058b0118 2005-01-03 devnull .IR name .
232 058b0118 2005-01-03 devnull .B nomark
233 058b0118 2005-01-03 devnull Turn off automatic `marking' of changes, so a set of related changes
234 058b0118 2005-01-03 devnull may be undone in a single
236 058b0118 2005-01-03 devnull interactive command.
238 058b0118 2005-01-03 devnull .B noscroll
239 058b0118 2005-01-03 devnull Turn off automatic `scrolling' of the window to show text written to the body.
242 058b0118 2005-01-03 devnull Equivalent to the
244 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
246 058b0118 2005-01-03 devnull .B scroll
247 058b0118 2005-01-03 devnull Cancel a
248 058b0118 2005-01-03 devnull .B noscroll
249 058b0118 2005-01-03 devnull message, returning the window to the default state wherein each write
252 058b0118 2005-01-03 devnull file causes the window to `scroll' to display the new text.
255 058b0118 2005-01-03 devnull Guarantee at least some of the selected text is visible on the display.
260 058b0118 2005-01-03 devnull is used in conjunction with
262 058b0118 2005-01-03 devnull for random access to the contents of the body.
263 058b0118 2005-01-03 devnull The file offset is ignored when writing the
265 058b0118 2005-01-03 devnull file; instead the location of the data to be read or written is determined by the state of the
268 058b0118 2005-01-03 devnull Text, which must contain only whole characters (no `partial runes'),
269 058b0118 2005-01-03 devnull written to
271 058b0118 2005-01-03 devnull replaces the characters addressed by the
273 058b0118 2005-01-03 devnull file and sets the address to the null string at the end of the written text.
274 058b0118 2005-01-03 devnull A read from
276 058b0118 2005-01-03 devnull returns as many whole characters as the read count will permit starting
277 058b0118 2005-01-03 devnull at the beginning of the
279 058b0118 2005-01-03 devnull address (the end of the address has no effect)
280 058b0118 2005-01-03 devnull and sets the address to the null string at the end of the returned
281 058b0118 2005-01-03 devnull characters.
283 9d01e221 2005-01-30 devnull .B errors
284 9d01e221 2005-01-30 devnull Writing to the
285 9d01e221 2005-01-30 devnull .B errors
286 9d01e221 2005-01-30 devnull file appends to the body of the
287 9d01e221 2005-01-30 devnull .IB dir /+Errors
288 9d01e221 2005-01-30 devnull window, where
290 9d01e221 2005-01-30 devnull is the directory currently named in the tag.
291 9d01e221 2005-01-30 devnull The window is created if necessary,
292 9d01e221 2005-01-30 devnull but not until text is actually written.
294 058b0118 2005-01-03 devnull .B event
295 058b0118 2005-01-03 devnull When a window's
296 058b0118 2005-01-03 devnull .B event
297 058b0118 2005-01-03 devnull file is open, changes to the window occur as always but the
298 058b0118 2005-01-03 devnull actions are also reported as
299 058b0118 2005-01-03 devnull messages to the reader of the file. Also, user actions with buttons 2 and 3
300 058b0118 2005-01-03 devnull (other than chorded
303 058b0118 2005-01-03 devnull .BR Paste ,
304 058b0118 2005-01-03 devnull which behave normally) have no immediate effect on the window;
305 058b0118 2005-01-03 devnull it is expected that the program reading the
306 058b0118 2005-01-03 devnull .B event
307 058b0118 2005-01-03 devnull file will interpret them.
308 058b0118 2005-01-03 devnull The messages have a fixed format:
309 058b0118 2005-01-03 devnull a character indicating the origin or cause of the action,
310 058b0118 2005-01-03 devnull a character indicating the type of the action,
311 058b0118 2005-01-03 devnull four free-format blank-terminated decimal numbers,
312 058b0118 2005-01-03 devnull optional text, and a newline.
313 058b0118 2005-01-03 devnull The first and second numbers are the character addresses of the action,
314 058b0118 2005-01-03 devnull the third is a flag,
315 058b0118 2005-01-03 devnull and the final is a count of the characters in the optional text, which
316 058b0118 2005-01-03 devnull may itself contain newlines.
317 058b0118 2005-01-03 devnull The origin characters are
319 058b0118 2005-01-03 devnull for writes to the
325 058b0118 2005-01-03 devnull for actions through the window's other files,
327 058b0118 2005-01-03 devnull for the keyboard, and
329 058b0118 2005-01-03 devnull for the mouse.
330 058b0118 2005-01-03 devnull The type characters are
332 058b0118 2005-01-03 devnull for text deleted from the body,
334 058b0118 2005-01-03 devnull for text deleted from the tag,
336 058b0118 2005-01-03 devnull for text inserted to the body,
338 058b0118 2005-01-03 devnull for text inserted to the tag,
340 058b0118 2005-01-03 devnull for a button 3 action in the body,
342 058b0118 2005-01-03 devnull for a button 3 action in the tag,
344 058b0118 2005-01-03 devnull for a button 2 action in the body, and
346 058b0118 2005-01-03 devnull for a button 2 action in the tag.
348 058b0118 2005-01-03 devnull If the relevant text has less than 256 characters, it is included in the message;
349 058b0118 2005-01-03 devnull otherwise it is elided, the fourth number is 0, and the program must read
350 058b0118 2005-01-03 devnull it from the
352 058b0118 2005-01-03 devnull file if needed. No text is sent on a
356 058b0118 2005-01-03 devnull message.
364 058b0118 2005-01-03 devnull the flag is always zero.
369 058b0118 2005-01-03 devnull the flag is a bitwise OR (reported decimally) of the following:
370 058b0118 2005-01-03 devnull 1 if the text indicated is recognized as an
372 058b0118 2005-01-03 devnull built-in command;
373 058b0118 2005-01-03 devnull 2 if the text indicated is a null string that has a non-null expansion;
374 058b0118 2005-01-03 devnull if so, another complete message will follow describing the expansion
375 058b0118 2005-01-03 devnull exactly as if it had been indicated explicitly (its flag will always be 0);
376 058b0118 2005-01-03 devnull 8 if the command has an extra (chorded) argument; if so,
377 058b0118 2005-01-03 devnull two more complete messages will follow reporting the argument (with
378 058b0118 2005-01-03 devnull all numbers 0 except the character count) and where it originated, in the form of
379 058b0118 2005-01-03 devnull a fully-qualified button 3 style address.
385 058b0118 2005-01-03 devnull the flag is the bitwise OR of the following:
388 058b0118 2005-01-03 devnull can interpret the action without loading a new file;
389 058b0118 2005-01-03 devnull 2 if a second (post-expansion) message follows, analogous to that with
391 058b0118 2005-01-03 devnull messages;
392 058b0118 2005-01-03 devnull 4 if the text is a file or window name (perhaps with address) rather than
393 058b0118 2005-01-03 devnull plain literal text.
395 058b0118 2005-01-03 devnull For messages with the 1 bit on in the flag,
396 058b0118 2005-01-03 devnull writing the message back to the
397 058b0118 2005-01-03 devnull .B event
398 058b0118 2005-01-03 devnull file, but with the flag, count, and text omitted,
399 058b0118 2005-01-03 devnull will cause the action to be applied to the file exactly as it would
400 058b0118 2005-01-03 devnull have been if the
401 058b0118 2005-01-03 devnull .B event
402 058b0118 2005-01-03 devnull file had not been open.
405 058b0118 2005-01-03 devnull holds contents of the window tag. It may be read at any byte offset.
406 058b0118 2005-01-03 devnull Text written to
408 058b0118 2005-01-03 devnull is always appended; the file offset is ignored.
410 9d01e221 2005-01-30 devnull .B xdata
412 9d01e221 2005-01-30 devnull .B xdata
413 9d01e221 2005-01-30 devnull file like
415 9d01e221 2005-01-30 devnull except that reads stop at the end address.
416 058b0118 2005-01-03 devnull .SH SOURCE
417 c3674de4 2005-01-11 devnull .B \*9/src/cmd/acme
418 058b0118 2005-01-03 devnull .SH SEE ALSO
419 058b0118 2005-01-03 devnull .IR rio (1),
420 058b0118 2005-01-03 devnull .IR acme (1)