diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 12:48:17 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 12:58:23 -0300 |
| commit | a99edf403dbcebae2ce557e2ba39078ffe876a92 (patch) | |
| tree | ab2b7de7934124c0f63c51737b6c651cf4e0dd98 /docs/typ/scripting.typ | |
| parent | 0c3f1694ad547d734b332b1f69620e8df7bcf97c (diff) | |
| download | pardes-a99edf403dbcebae2ce557e2ba39078ffe876a92.tar.gz pardes-a99edf403dbcebae2ce557e2ba39078ffe876a92.zip | |
Builtins are written by name: each chapter and the tutor define Look and Exec once and then say Look and Exec; the cheatsheet draws every mouse button as its icon; one-button clicks (Alt is B2, Super is B3) are in the guide and cheatsheet; building says how to send patches to the list
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/typ/scripting.typ')
| -rw-r--r-- | docs/typ/scripting.typ | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/typ/scripting.typ b/docs/typ/scripting.typ index b3f5ca26..9d65f8de 100644 --- a/docs/typ/scripting.typ +++ b/docs/typ/scripting.typ @@ -48,7 +48,8 @@ echo Save | wr pane/$n/ctl && gofmt -w "$f" && echo get | wr pane/$n/ctl `get` on a pane's ctl reloads its text from the file on disk. -Type `Fmt` into a Go pane's tag and middle-click it; its output +Type `Fmt` into a Go pane's tag and #word("Exec") it (middle-click: run +the builtin a word names, or else run it as a shell line); its output shows in a command pane. To have `Fmt` in every Go file's tag, follow the log and add it to each new `.go` pane (with a mount): @@ -93,9 +94,10 @@ open stays open: read its #file("body") before you close it. In == Event helpers -Holding a pane's #file("event") open takes its middle- and right-clicks: they arrive as acme's records instead of acting, and writing a +Holding a pane's #file("event") open takes its #word("Exec") and #word("Look") clicks (right-click: open what +the text names, or else find it): they arrive as acme's records instead of acting, and writing a record back has pardes do it. A record is a line, `MX31 36 1 5 Upper`: who -(`M` mouse, `K` keyboard, `E` or `F` a write to a file), what (`X` execute or `L` look +(`M` mouse, `K` keyboard, `E` or `F` a write to a file), what (`X` #word("Exec") or `L` #word("Look") in the body, `x` `l` in the tag), the range, a flag, the text's length and the text (#doc("fs", section: "event")). This helper gives pane `$1` the tag words `Upper` (upper-case the selection) and @@ -123,7 +125,7 @@ exec 3<&- # let event go: clicks act again - A refused write says only `Invalid argument` or `Input/output error`; its reason is `grep '^err' $m/log | tail -1`, not the log's last line, - which after a refused Del may be `+Unsaved`'s `new`. A write that + which after a refused #word("Del") may be `+Unsaved`'s `new`. A write that succeeds adds no record, so check its status first. - The root #file("look") and #file("exec") act at the pane with the keyboard, which another client, an idle shell or an event helper may @@ -134,7 +136,7 @@ exec 3<&- # let event go: clicks act again - #file("addr") is the pane's and moves on: each `/re/` searches from the last address, and a #file("data") write leaves it past the text. Write #file("addr") before each replacement; a failed one leaves none. -- An Edit `x` that matches nothing succeeds: check the text. +- An #word("Edit") `x` that matches nothing succeeds: check the text. - Through a mount, `printf 'a\nb\n' > ctl` arrives one write per line: send a block as one write, ending in a newline. - Read #file("event") on a descriptor your shell owns, never |
