summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.agents/skills/pardes-9p/SKILL.md12
-rw-r--r--docs/fs.md27
2 files changed, 33 insertions, 6 deletions
diff --git a/.agents/skills/pardes-9p/SKILL.md b/.agents/skills/pardes-9p/SKILL.md
index 26f3ff19..4f903d5d 100644
--- a/.agents/skills/pardes-9p/SKILL.md
+++ b/.agents/skills/pardes-9p/SKILL.md
@@ -64,6 +64,8 @@ $m/pane/<n>/pty/run write one line, read `exit N` + its output, or `busy` / `e
(a fresh terminal: waits for its first prompt; if none comes, interrupt the read)
$m/log recent events, then EOF: new|del|rename|save <serial> <name>, msg <serial|-> <text>,
run <serial> <line>, exit <serial> <N|?>, send <from> <to> <repl-id>,
+ ask <serial> <what> <choices>, answer <serial> <choice|->, changed <serial>
+ [reloaded|deleted], newcol|delcol <serial>, restored|restoredcol <old> <new>,
dump|restore <path>, err <serial|-> <file>: <why>
(exec 3<>$m/log; echo follow >&3; cat <&3 replays what is there, then waits for new
ones; `echo follow new` waits for new ones only; tail -f does not wait;
@@ -174,7 +176,9 @@ REPLs bound for a language an exec asks which, logged `ask <serial> repl a b`
log says `answer <serial> a|-`). Kill does not stop what a REPL runs (it was
typed, not started by pardes): `echo 'sig INT' > $m/pane/<repl>/pty/ctl`
interrupts it. A range of a `.py` pane goes to its REPL by writing the event
-record `MX<q0> <q1>` to that pane's `event`. `Tty`'s argument is a shell
+record `MX<q0> <q1>` to that pane's `event`. A chorded exec's record (flag 8)
+is followed by two, its argument and where it came from; write all three back
+as read (one write or three) and it runs once with its argument. `Tty`'s argument is a shell
(`Tty fish`), and `Tty` on a pane's ctl opens a new terminal pane. After a
Restore, panes have new serials (`restored <old> <new>` in the log), a
command pane shows `exit ?` and does not run again, and REPLs are unbound. Multi-line code
@@ -243,7 +247,11 @@ env printf 'Edit ,x/foo/{\ni/</\na/>/\n}\n' > $pane/ctl
| Delete that range | `: > $pane/data` | truncate `data` (open with OTRUNC) |
A write leaves `addr` just past what it wrote, so a second `echo x > data`
-inserts after the first: write `addr` again before each replacement. A read
+inserts after the first: write `addr` again before each replacement. Each
+`data` write is one undo step; to make a loop's writes one, `echo 1 > mark`
+(an undo point now), `echo 0 > mark`, the writes, then `echo 1 > mark`.
+A `+New` scratch counts as unsaved (and holds up Exit, Restore, Del) only
+once it holds 100 bytes or more. A read
of `data` or `xdata` moves `addr` past what it read, as in acme.
Truncating `data` is pardes's own (acme ignores OTRUNC and always inserts).
| Read the selection | `cat $pane/dot` (offsets), `cat $pane/sel` (text) | the same two reads |
diff --git a/docs/fs.md b/docs/fs.md
index 14b82d48..0a7cee7d 100644
--- a/docs/fs.md
+++ b/docs/fs.md
@@ -313,11 +313,16 @@ same tree without leaving the process.
`/look` and `/exec` are the editor's two clicks, one per line of a write:
- a line written to `look` is a right click on it: a path opens a file,
- `file:12` jumps to a line, a directory opens a shell there, a URL opens in
- the browser, and a plain word, as acme's look3 does, selects its next
+ `file:12` jumps to a line, a directory opens a terminal there that runs
+ `ls` once (pardes has no directory listing pane of acme's kind; a shell
+ in it is where one goes on from a directory), a URL opens in the
+ browser, and a plain word, as acme's look3 does, selects its next
place in that pane after the dot, wrapping at the end, opening nothing
(`LookWord list` on the root ctl lists every place in a `+Search` pane
- instead, as pardes did before; `LookWord search` is the default).
+ instead, as pardes did before; `LookWord search` is the default). In a
+ terminal, which has no dot to go on from, a plain word is always listed
+ in a `+Search` pane, its rows naming the terminal as `@p<serial>:<line>`,
+ and look reads that pane back.
- a line written to `exec` is a middle click: a command word from
`src/builtins.zig` (`Save`, `Del`, `New`, `Newcol`, `Mount NAME DIAL`,
`Unmount NAME`, `Dump`, `Restore`, `Msg TEXT`, `Find`, `Grep`, `Tty`, ...;
@@ -622,7 +627,21 @@ missed its target cannot then write at the last one.
The three flag files `dirty`, `mark` and `scroll` read `0` or `1` and take
`0` or `1`: whether the buffer differs from its file, whether a write pushes
an undo point (writing `1` pushes one now), and whether a write scrolls the
-pane.
+pane. Every `data`, `xdata` or `body` write is an undo step of its own
+while `mark` is 1; to make a loop's writes one step, write `1` (an undo
+point here), then `0`, the writes, then `1` again.
+
+Which writes fail and which only say so:
+
+| file | a write fails (the errno, an `err` record) | said on the message row and logged as `msg`, the write succeeding |
+|---|---|---|
+| `ctl` (root, pane, column) | a malformed line, an unknown word, a builtin's failure, a refusal (Modified...) | what a builtin says when it works |
+| `look`, `exec`, `tagexec`, a column's `exec` | a control character, a line over 1024 bytes, no pane slot or room | a look that finds nothing, a command's own failure, a builtin's failure |
+| `addr`, `dot`, `limit` | an address that does not evaluate | -- |
+| `data`, `xdata` | no address (the last one failed) | -- |
+| `body`, `tag`, `name`, `sel`, the flag files | a bad value, a pane gone | -- |
+| `event` | a malformed record, a range past the text | what the action it runs says |
+| `pty/ctl`, `pty/data`, `pty/run` | a malformed verb, a size out of range, a pane that is no terminal | -- |
`tag` reads the whole tag as the pane shows it: the computed path or PDF
page (no mark for unsaved text: the grip shows that, and `dirty` says it),