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 d91ab9ea 2007-05-15 devnull file, described above, plus three more fields: the width of the
163 d91ab9ea 2007-05-15 devnull window in pixels, the name of the font used in the window,
164 d91ab9ea 2007-05-15 devnull and the width of a tab character in pixels.
165 058b0118 2005-01-03 devnull Text messages may be written to
167 058b0118 2005-01-03 devnull to affect the window.
168 058b0118 2005-01-03 devnull Each message is terminated by a newline and multiple
169 058b0118 2005-01-03 devnull messages may be sent in a single write.
171 058b0118 2005-01-03 devnull .TF limit=addr
173 058b0118 2005-01-03 devnull .B addr=dot
176 058b0118 2005-01-03 devnull address to that of the user's selected text in the window.
178 058b0118 2005-01-03 devnull .B clean
179 058b0118 2005-01-03 devnull Mark the window clean as though it has just been written.
181 058b0118 2005-01-03 devnull .B dirty
182 058b0118 2005-01-03 devnull Mark the window dirty, the opposite of clean.
184 058b0118 2005-01-03 devnull .B cleartag
185 058b0118 2005-01-03 devnull Remove all text in the tag after the vertical bar.
188 058b0118 2005-01-03 devnull Equivalent to the
190 058b0118 2005-01-03 devnull interactive command.
192 058b0118 2005-01-03 devnull .B delete
193 058b0118 2005-01-03 devnull Equivalent to the
194 058b0118 2005-01-03 devnull .B Delete
195 058b0118 2005-01-03 devnull interactive command.
197 058b0118 2005-01-03 devnull .B dot=addr
198 058b0118 2005-01-03 devnull Set the user's selected text in the window to the text addressed by the
200 058b0118 2005-01-03 devnull address.
202 058b0118 2005-01-03 devnull .BI dump " command
203 058b0118 2005-01-03 devnull Set the command string to recreate the window from a dump file.
205 058b0118 2005-01-03 devnull .BI dumpdir " directory
206 058b0118 2005-01-03 devnull Set the directory in which to run the command to recreate the window from a dump file.
209 058b0118 2005-01-03 devnull Equivalent to the
211 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
213 058b0118 2005-01-03 devnull .B limit=addr
214 058b0118 2005-01-03 devnull When the
216 058b0118 2005-01-03 devnull file is first opened, regular expression context searches in
218 058b0118 2005-01-03 devnull addresses examine the whole file; this message restricts subsequent
219 058b0118 2005-01-03 devnull searches to the current
221 058b0118 2005-01-03 devnull address.
225 058b0118 2005-01-03 devnull .BR nomark ,
226 058b0118 2005-01-03 devnull returning the window to the usual state wherein each modification to the
227 058b0118 2005-01-03 devnull body must be undone individually.
229 058b0118 2005-01-03 devnull .BI name " name
230 058b0118 2005-01-03 devnull Set the name of the window to
231 058b0118 2005-01-03 devnull .IR name .
233 058b0118 2005-01-03 devnull .B nomark
234 058b0118 2005-01-03 devnull Turn off automatic `marking' of changes, so a set of related changes
235 058b0118 2005-01-03 devnull may be undone in a single
237 058b0118 2005-01-03 devnull interactive command.
239 058b0118 2005-01-03 devnull .B noscroll
240 058b0118 2005-01-03 devnull Turn off automatic `scrolling' of the window to show text written to the body.
243 058b0118 2005-01-03 devnull Equivalent to the
245 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
247 058b0118 2005-01-03 devnull .B scroll
248 058b0118 2005-01-03 devnull Cancel a
249 058b0118 2005-01-03 devnull .B noscroll
250 058b0118 2005-01-03 devnull message, returning the window to the default state wherein each write
253 058b0118 2005-01-03 devnull file causes the window to `scroll' to display the new text.
256 058b0118 2005-01-03 devnull Guarantee at least some of the selected text is visible on the display.
261 058b0118 2005-01-03 devnull is used in conjunction with
263 058b0118 2005-01-03 devnull for random access to the contents of the body.
264 058b0118 2005-01-03 devnull The file offset is ignored when writing the
266 058b0118 2005-01-03 devnull file; instead the location of the data to be read or written is determined by the state of the
269 058b0118 2005-01-03 devnull Text, which must contain only whole characters (no `partial runes'),
270 058b0118 2005-01-03 devnull written to
272 058b0118 2005-01-03 devnull replaces the characters addressed by the
274 058b0118 2005-01-03 devnull file and sets the address to the null string at the end of the written text.
275 058b0118 2005-01-03 devnull A read from
277 058b0118 2005-01-03 devnull returns as many whole characters as the read count will permit starting
278 058b0118 2005-01-03 devnull at the beginning of the
280 058b0118 2005-01-03 devnull address (the end of the address has no effect)
281 058b0118 2005-01-03 devnull and sets the address to the null string at the end of the returned
282 058b0118 2005-01-03 devnull characters.
284 9d01e221 2005-01-30 devnull .B errors
285 9d01e221 2005-01-30 devnull Writing to the
286 9d01e221 2005-01-30 devnull .B errors
287 9d01e221 2005-01-30 devnull file appends to the body of the
288 9d01e221 2005-01-30 devnull .IB dir /+Errors
289 9d01e221 2005-01-30 devnull window, where
291 9d01e221 2005-01-30 devnull is the directory currently named in the tag.
292 9d01e221 2005-01-30 devnull The window is created if necessary,
293 9d01e221 2005-01-30 devnull but not until text is actually written.
295 058b0118 2005-01-03 devnull .B event
296 058b0118 2005-01-03 devnull When a window's
297 058b0118 2005-01-03 devnull .B event
298 058b0118 2005-01-03 devnull file is open, changes to the window occur as always but the
299 058b0118 2005-01-03 devnull actions are also reported as
300 058b0118 2005-01-03 devnull messages to the reader of the file. Also, user actions with buttons 2 and 3
301 058b0118 2005-01-03 devnull (other than chorded
304 058b0118 2005-01-03 devnull .BR Paste ,
305 058b0118 2005-01-03 devnull which behave normally) have no immediate effect on the window;
306 058b0118 2005-01-03 devnull it is expected that the program reading the
307 058b0118 2005-01-03 devnull .B event
308 058b0118 2005-01-03 devnull file will interpret them.
309 058b0118 2005-01-03 devnull The messages have a fixed format:
310 058b0118 2005-01-03 devnull a character indicating the origin or cause of the action,
311 058b0118 2005-01-03 devnull a character indicating the type of the action,
312 058b0118 2005-01-03 devnull four free-format blank-terminated decimal numbers,
313 058b0118 2005-01-03 devnull optional text, and a newline.
314 058b0118 2005-01-03 devnull The first and second numbers are the character addresses of the action,
315 058b0118 2005-01-03 devnull the third is a flag,
316 058b0118 2005-01-03 devnull and the final is a count of the characters in the optional text, which
317 058b0118 2005-01-03 devnull may itself contain newlines.
318 058b0118 2005-01-03 devnull The origin characters are
320 058b0118 2005-01-03 devnull for writes to the
326 058b0118 2005-01-03 devnull for actions through the window's other files,
328 058b0118 2005-01-03 devnull for the keyboard, and
330 058b0118 2005-01-03 devnull for the mouse.
331 058b0118 2005-01-03 devnull The type characters are
333 058b0118 2005-01-03 devnull for text deleted from the body,
335 058b0118 2005-01-03 devnull for text deleted from the tag,
337 058b0118 2005-01-03 devnull for text inserted to the body,
339 058b0118 2005-01-03 devnull for text inserted to the tag,
341 058b0118 2005-01-03 devnull for a button 3 action in the body,
343 058b0118 2005-01-03 devnull for a button 3 action in the tag,
345 058b0118 2005-01-03 devnull for a button 2 action in the body, and
347 058b0118 2005-01-03 devnull for a button 2 action in the tag.
349 058b0118 2005-01-03 devnull If the relevant text has less than 256 characters, it is included in the message;
350 058b0118 2005-01-03 devnull otherwise it is elided, the fourth number is 0, and the program must read
351 058b0118 2005-01-03 devnull it from the
353 058b0118 2005-01-03 devnull file if needed. No text is sent on a
357 058b0118 2005-01-03 devnull message.
365 058b0118 2005-01-03 devnull the flag is always zero.
370 058b0118 2005-01-03 devnull the flag is a bitwise OR (reported decimally) of the following:
371 058b0118 2005-01-03 devnull 1 if the text indicated is recognized as an
373 058b0118 2005-01-03 devnull built-in command;
374 058b0118 2005-01-03 devnull 2 if the text indicated is a null string that has a non-null expansion;
375 058b0118 2005-01-03 devnull if so, another complete message will follow describing the expansion
376 058b0118 2005-01-03 devnull exactly as if it had been indicated explicitly (its flag will always be 0);
377 058b0118 2005-01-03 devnull 8 if the command has an extra (chorded) argument; if so,
378 058b0118 2005-01-03 devnull two more complete messages will follow reporting the argument (with
379 058b0118 2005-01-03 devnull all numbers 0 except the character count) and where it originated, in the form of
380 058b0118 2005-01-03 devnull a fully-qualified button 3 style address.
386 058b0118 2005-01-03 devnull the flag is the bitwise OR of the following:
389 058b0118 2005-01-03 devnull can interpret the action without loading a new file;
390 058b0118 2005-01-03 devnull 2 if a second (post-expansion) message follows, analogous to that with
392 058b0118 2005-01-03 devnull messages;
393 058b0118 2005-01-03 devnull 4 if the text is a file or window name (perhaps with address) rather than
394 058b0118 2005-01-03 devnull plain literal text.
396 058b0118 2005-01-03 devnull For messages with the 1 bit on in the flag,
397 058b0118 2005-01-03 devnull writing the message back to the
398 058b0118 2005-01-03 devnull .B event
399 058b0118 2005-01-03 devnull file, but with the flag, count, and text omitted,
400 058b0118 2005-01-03 devnull will cause the action to be applied to the file exactly as it would
401 058b0118 2005-01-03 devnull have been if the
402 058b0118 2005-01-03 devnull .B event
403 058b0118 2005-01-03 devnull file had not been open.
406 058b0118 2005-01-03 devnull holds contents of the window tag. It may be read at any byte offset.
407 058b0118 2005-01-03 devnull Text written to
409 058b0118 2005-01-03 devnull is always appended; the file offset is ignored.
411 9d01e221 2005-01-30 devnull .B xdata
413 9d01e221 2005-01-30 devnull .B xdata
414 9d01e221 2005-01-30 devnull file like
416 9d01e221 2005-01-30 devnull except that reads stop at the end address.
417 058b0118 2005-01-03 devnull .SH SOURCE
418 c3674de4 2005-01-11 devnull .B \*9/src/cmd/acme
419 058b0118 2005-01-03 devnull .SH SEE ALSO
420 058b0118 2005-01-03 devnull .IR rio (1),
421 058b0118 2005-01-03 devnull .IR acme (1)