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 4a3fb872 2014-04-30 rsc 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 4a3fb872 2014-04-30 rsc reports a log of window operations since the opening of the
102 4a3fb872 2014-04-30 rsc Each line describes a single operation using three fields separated by single spaces:
103 4a3fb872 2014-04-30 rsc the decimal window ID, the operation, and the window name.
104 4a3fb872 2014-04-30 rsc Reading from
106 4a3fb872 2014-04-30 rsc blocks until there is an operation to report, so reading the file
107 4a3fb872 2014-04-30 rsc can be used to monitor editor activity and react to changes.
108 4a3fb872 2014-04-30 rsc The reported operations are
110 4a3fb872 2014-04-30 rsc (window creation),
112 4a3fb872 2014-04-30 rsc (window creation via zerox),
117 4a3fb872 2014-04-30 rsc (window deletion).
118 4a3fb872 2014-04-30 rsc The window name can be the empty string; in particular it is empty in
120 4a3fb872 2014-04-30 rsc log entries corresponding to windows created by external programs.
123 4a3fb872 2014-04-30 rsc is a directory analogous to the numbered directories
124 058b0118 2005-01-03 devnull .RI ( q.v. ).
125 058b0118 2005-01-03 devnull Accessing any
128 058b0118 2005-01-03 devnull creates a new window. Thus to cause text to appear in a new window,
129 058b0118 2005-01-03 devnull write it to
130 058b0118 2005-01-03 devnull .BR /dev/new/body .
131 058b0118 2005-01-03 devnull For more control, open
132 058b0118 2005-01-03 devnull .BR /dev/new/ctl
133 058b0118 2005-01-03 devnull and use the interface described below.
138 058b0118 2005-01-03 devnull window has associated a directory numbered by its ID.
139 058b0118 2005-01-03 devnull Window IDs are chosen sequentially and may be discovered by the
141 058b0118 2005-01-03 devnull command, by
142 058b0118 2005-01-03 devnull reading the
144 058b0118 2005-01-03 devnull file, or
145 058b0118 2005-01-03 devnull indirectly through the
146 058b0118 2005-01-03 devnull .B index
147 058b0118 2005-01-03 devnull file. The files in the numbered directories are as follows.
150 058b0118 2005-01-03 devnull may be written with any textual address (line number, regular expression, etc.),
151 058b0118 2005-01-03 devnull in the format understood by button 3 but without the initial colon, including compound addresses,
152 058b0118 2005-01-03 devnull to set the address for text accessed through the
155 058b0118 2005-01-03 devnull When read, it returns the value of the address that would next be read
156 058b0118 2005-01-03 devnull or written through the
158 058b0118 2005-01-03 devnull file, in the format
159 058b0118 2005-01-03 devnull .BI # m ,# n
164 058b0118 2005-01-03 devnull are character (not byte) offsets. If
168 058b0118 2005-01-03 devnull are identical, the format is just
169 058b0118 2005-01-03 devnull .BI # m\f1.
170 058b0118 2005-01-03 devnull Thus a regular expression may be evaluated by writing it to
172 058b0118 2005-01-03 devnull and reading it back.
175 058b0118 2005-01-03 devnull address has no effect on the user's selection of text.
178 058b0118 2005-01-03 devnull holds contents of the window body. It may be read at any byte offset.
179 058b0118 2005-01-03 devnull Text written to
181 058b0118 2005-01-03 devnull is always appended; the file offset is ignored.
184 058b0118 2005-01-03 devnull may be read to recover the five numbers as held in the
185 058b0118 2005-01-03 devnull .B index
186 d91ab9ea 2007-05-15 devnull file, described above, plus three more fields: the width of the
187 d91ab9ea 2007-05-15 devnull window in pixels, the name of the font used in the window,
188 d91ab9ea 2007-05-15 devnull and the width of a tab character in pixels.
189 058b0118 2005-01-03 devnull Text messages may be written to
191 058b0118 2005-01-03 devnull to affect the window.
192 058b0118 2005-01-03 devnull Each message is terminated by a newline and multiple
193 058b0118 2005-01-03 devnull messages may be sent in a single write.
195 058b0118 2005-01-03 devnull .TF limit=addr
197 058b0118 2005-01-03 devnull .B addr=dot
200 058b0118 2005-01-03 devnull address to that of the user's selected text in the window.
202 058b0118 2005-01-03 devnull .B clean
203 058b0118 2005-01-03 devnull Mark the window clean as though it has just been written.
205 058b0118 2005-01-03 devnull .B dirty
206 058b0118 2005-01-03 devnull Mark the window dirty, the opposite of clean.
208 058b0118 2005-01-03 devnull .B cleartag
209 058b0118 2005-01-03 devnull Remove all text in the tag after the vertical bar.
212 058b0118 2005-01-03 devnull Equivalent to the
214 058b0118 2005-01-03 devnull interactive command.
216 058b0118 2005-01-03 devnull .B delete
217 058b0118 2005-01-03 devnull Equivalent to the
218 058b0118 2005-01-03 devnull .B Delete
219 058b0118 2005-01-03 devnull interactive command.
221 058b0118 2005-01-03 devnull .B dot=addr
222 058b0118 2005-01-03 devnull Set the user's selected text in the window to the text addressed by the
224 058b0118 2005-01-03 devnull address.
226 058b0118 2005-01-03 devnull .BI dump " command
227 058b0118 2005-01-03 devnull Set the command string to recreate the window from a dump file.
229 058b0118 2005-01-03 devnull .BI dumpdir " directory
230 058b0118 2005-01-03 devnull Set the directory in which to run the command to recreate the window from a dump file.
233 058b0118 2005-01-03 devnull Equivalent to the
235 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
237 058b0118 2005-01-03 devnull .B limit=addr
238 058b0118 2005-01-03 devnull When the
240 058b0118 2005-01-03 devnull file is first opened, regular expression context searches in
242 058b0118 2005-01-03 devnull addresses examine the whole file; this message restricts subsequent
243 058b0118 2005-01-03 devnull searches to the current
245 058b0118 2005-01-03 devnull address.
249 058b0118 2005-01-03 devnull .BR nomark ,
250 058b0118 2005-01-03 devnull returning the window to the usual state wherein each modification to the
251 058b0118 2005-01-03 devnull body must be undone individually.
253 058b0118 2005-01-03 devnull .BI name " name
254 058b0118 2005-01-03 devnull Set the name of the window to
255 058b0118 2005-01-03 devnull .IR name .
257 058b0118 2005-01-03 devnull .B nomark
258 058b0118 2005-01-03 devnull Turn off automatic `marking' of changes, so a set of related changes
259 058b0118 2005-01-03 devnull may be undone in a single
261 058b0118 2005-01-03 devnull interactive command.
264 058b0118 2005-01-03 devnull Equivalent to the
266 058b0118 2005-01-03 devnull interactive command with no arguments; accepts no arguments.
269 058b0118 2005-01-03 devnull Guarantee at least some of the selected text is visible on the display.
274 058b0118 2005-01-03 devnull is used in conjunction with
276 058b0118 2005-01-03 devnull for random access to the contents of the body.
277 058b0118 2005-01-03 devnull The file offset is ignored when writing the
279 058b0118 2005-01-03 devnull file; instead the location of the data to be read or written is determined by the state of the
282 058b0118 2005-01-03 devnull Text, which must contain only whole characters (no `partial runes'),
283 058b0118 2005-01-03 devnull written to
285 058b0118 2005-01-03 devnull replaces the characters addressed by the
287 058b0118 2005-01-03 devnull file and sets the address to the null string at the end of the written text.
288 058b0118 2005-01-03 devnull A read from
290 058b0118 2005-01-03 devnull returns as many whole characters as the read count will permit starting
291 058b0118 2005-01-03 devnull at the beginning of the
293 058b0118 2005-01-03 devnull address (the end of the address has no effect)
294 058b0118 2005-01-03 devnull and sets the address to the null string at the end of the returned
295 058b0118 2005-01-03 devnull characters.
297 9d01e221 2005-01-30 devnull .B errors
298 9d01e221 2005-01-30 devnull Writing to the
299 9d01e221 2005-01-30 devnull .B errors
300 9d01e221 2005-01-30 devnull file appends to the body of the
301 9d01e221 2005-01-30 devnull .IB dir /+Errors
302 9d01e221 2005-01-30 devnull window, where
304 9d01e221 2005-01-30 devnull is the directory currently named in the tag.
305 9d01e221 2005-01-30 devnull The window is created if necessary,
306 9d01e221 2005-01-30 devnull but not until text is actually written.
308 058b0118 2005-01-03 devnull .B event
309 058b0118 2005-01-03 devnull When a window's
310 058b0118 2005-01-03 devnull .B event
311 058b0118 2005-01-03 devnull file is open, changes to the window occur as always but the
312 058b0118 2005-01-03 devnull actions are also reported as
313 058b0118 2005-01-03 devnull messages to the reader of the file. Also, user actions with buttons 2 and 3
314 058b0118 2005-01-03 devnull (other than chorded
317 058b0118 2005-01-03 devnull .BR Paste ,
318 058b0118 2005-01-03 devnull which behave normally) have no immediate effect on the window;
319 058b0118 2005-01-03 devnull it is expected that the program reading the
320 058b0118 2005-01-03 devnull .B event
321 058b0118 2005-01-03 devnull file will interpret them.
322 058b0118 2005-01-03 devnull The messages have a fixed format:
323 058b0118 2005-01-03 devnull a character indicating the origin or cause of the action,
324 058b0118 2005-01-03 devnull a character indicating the type of the action,
325 058b0118 2005-01-03 devnull four free-format blank-terminated decimal numbers,
326 058b0118 2005-01-03 devnull optional text, and a newline.
327 058b0118 2005-01-03 devnull The first and second numbers are the character addresses of the action,
328 058b0118 2005-01-03 devnull the third is a flag,
329 058b0118 2005-01-03 devnull and the final is a count of the characters in the optional text, which
330 058b0118 2005-01-03 devnull may itself contain newlines.
331 058b0118 2005-01-03 devnull The origin characters are
333 058b0118 2005-01-03 devnull for writes to the
339 058b0118 2005-01-03 devnull for actions through the window's other files,
341 058b0118 2005-01-03 devnull for the keyboard, and
343 058b0118 2005-01-03 devnull for the mouse.
344 058b0118 2005-01-03 devnull The type characters are
346 058b0118 2005-01-03 devnull for text deleted from the body,
348 058b0118 2005-01-03 devnull for text deleted from the tag,
350 058b0118 2005-01-03 devnull for text inserted to the body,
352 058b0118 2005-01-03 devnull for text inserted to the tag,
354 058b0118 2005-01-03 devnull for a button 3 action in the body,
356 058b0118 2005-01-03 devnull for a button 3 action in the tag,
358 058b0118 2005-01-03 devnull for a button 2 action in the body, and
360 058b0118 2005-01-03 devnull for a button 2 action in the tag.
362 058b0118 2005-01-03 devnull If the relevant text has less than 256 characters, it is included in the message;
363 058b0118 2005-01-03 devnull otherwise it is elided, the fourth number is 0, and the program must read
364 058b0118 2005-01-03 devnull it from the
366 058b0118 2005-01-03 devnull file if needed. No text is sent on a
370 058b0118 2005-01-03 devnull message.
378 058b0118 2005-01-03 devnull the flag is always zero.
383 058b0118 2005-01-03 devnull the flag is a bitwise OR (reported decimally) of the following:
384 058b0118 2005-01-03 devnull 1 if the text indicated is recognized as an
386 058b0118 2005-01-03 devnull built-in command;
387 058b0118 2005-01-03 devnull 2 if the text indicated is a null string that has a non-null expansion;
388 058b0118 2005-01-03 devnull if so, another complete message will follow describing the expansion
389 058b0118 2005-01-03 devnull exactly as if it had been indicated explicitly (its flag will always be 0);
390 058b0118 2005-01-03 devnull 8 if the command has an extra (chorded) argument; if so,
391 058b0118 2005-01-03 devnull two more complete messages will follow reporting the argument (with
392 058b0118 2005-01-03 devnull all numbers 0 except the character count) and where it originated, in the form of
393 058b0118 2005-01-03 devnull a fully-qualified button 3 style address.
399 058b0118 2005-01-03 devnull the flag is the bitwise OR of the following:
402 058b0118 2005-01-03 devnull can interpret the action without loading a new file;
403 058b0118 2005-01-03 devnull 2 if a second (post-expansion) message follows, analogous to that with
405 058b0118 2005-01-03 devnull messages;
406 058b0118 2005-01-03 devnull 4 if the text is a file or window name (perhaps with address) rather than
407 058b0118 2005-01-03 devnull plain literal text.
409 058b0118 2005-01-03 devnull For messages with the 1 bit on in the flag,
410 058b0118 2005-01-03 devnull writing the message back to the
411 058b0118 2005-01-03 devnull .B event
412 058b0118 2005-01-03 devnull file, but with the flag, count, and text omitted,
413 058b0118 2005-01-03 devnull will cause the action to be applied to the file exactly as it would
414 058b0118 2005-01-03 devnull have been if the
415 058b0118 2005-01-03 devnull .B event
416 058b0118 2005-01-03 devnull file had not been open.
419 058b0118 2005-01-03 devnull holds contents of the window tag. It may be read at any byte offset.
420 058b0118 2005-01-03 devnull Text written to
422 058b0118 2005-01-03 devnull is always appended; the file offset is ignored.
424 9d01e221 2005-01-30 devnull .B xdata
426 9d01e221 2005-01-30 devnull .B xdata
427 9d01e221 2005-01-30 devnull file like
429 9d01e221 2005-01-30 devnull except that reads stop at the end address.
430 058b0118 2005-01-03 devnull .SH SOURCE
431 c3674de4 2005-01-11 devnull .B \*9/src/cmd/acme
432 058b0118 2005-01-03 devnull .SH SEE ALSO
433 058b0118 2005-01-03 devnull .IR rio (1),
434 058b0118 2005-01-03 devnull .IR acme (1)