summaryrefslogtreecommitdiff
path: root/docs/typ/scripting.typ
diff options
context:
space:
mode:
Diffstat (limited to 'docs/typ/scripting.typ')
-rw-r--r--docs/typ/scripting.typ12
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