From 5a62039f3e91f62e45bb0e969a3b76568d4f92ff Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 15:59:04 -0300 Subject: help: the words of looking and finding documented for a user (item 5's second group: `Look`, `Exec`, `Find`, `Grep`, `Search`, `More`, `Panes`, `Recent`, `LookNext`, `LookPrev`), each sentence checked against its run (core/look.zig `lookAt` and `lookWalk`, core/exec.zig `executeFrom`, core/builtins.zig `search`, core/Query.zig `open`, core/Stream.zig `moreFor`) and the guide's chapters "Look" and "Search": Look (its argument's address forms, where a relative path is found, bare: the selection, else what is under the cursor), Exec (a builtin, else the line: typed into the terminal it runs from at an idle, empty prompt, else a command pane, `$SHELL -c`, `exit N`, Kill; run by name never a REPL's), Find and Grep (a query pane under the pane, line 1 the word and the argument; with a word listed, the keyboard left where it was, bare typed into; Find fuzzy over names, Grep the text as it is; 2000 lines and More; a script's search that finds nothing fails, `not found`), Search (line 1's first word names the source, `/` when none does; `SPC b b`, `SPC s s`, `SPC /`), More, Panes (open, then closed this session; Enter brings one back), Recent, LookNext and LookPrev (what a Look would open, walked through the panes, the keyboard with it); was: Grep "Find's sibling ... on the disk engine's worker", Exec with no word of where a command's output goes; docs/typ/builtins-tui.json regenerated Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/builtins.zig | 62 ++++++++++++++++++++++++++++++++++++---------- docs/typ/builtins-tui.json | 20 +++++++-------- 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/core/builtins.zig b/core/builtins.zig index 11505b2c..5c29bf59 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -375,7 +375,14 @@ pub const registry = struct { // ---- the two acme verbs ---- -/// Look at its argument: open the file or address it names, else find the word, as a right click does. +/// Look at its argument as B3 does: open the file or address it names, else +/// find the word. +/// +/// `Look notes.txt:12` opens the file at line 12, or goes to the pane already +/// showing it; an address may be a line, `:12:5`, `/re/`, a directory (a pane +/// listing it) or a URL (the browser, by a plumbing rule). A relative path is +/// found in the directory of the pane looked from, then of each pane on the +/// jump list. Bare (Enter): the selection, else what is under the cursor. pub const Look = struct { pub const takes_arg = true; pub const requires_arg = true; @@ -390,7 +397,13 @@ pub const Look = struct { } }; -/// Execute its argument as a middle click on it would, a builtin or a shell command. +/// Run its argument as B2 on it would: a builtin, else a shell command. +/// +/// `Exec Newcol` runs the builtin. `Exec make test` runs the line: from a +/// terminal at an idle, empty prompt, typed into its shell; from anywhere +/// else, in a command pane (a terminal running `$SHELL -c` the line, which +/// shows its output and `exit N` when it ends; Kill stops it). Run by name, a +/// line is never a REPL's. pub const Exec = struct { pub const takes_arg = true; pub const requires_arg = true; @@ -1672,7 +1685,12 @@ pub const Mini = struct { const e_search_miss_find = "Find: name not found"; const e_search_miss_grep = "Grep: text not found"; -/// List the files below this pane's directory whose names hold its argument, in a +Search. +/// List the files below this pane's directory whose names match its argument. +/// +/// A query pane under this pane, its line 1 `Find `, the files under it +/// by a fuzzy match of their names: with a word, listed, the keyboard left +/// where it was; bare (`SPC f f`), typed into. Enter or B3 on a row opens +/// that file. A script's Find that finds nothing fails, `not found`. pub const Find = struct { pub const takes_arg = true; // A script's Find names what to find (bare, it is a key's prompt). @@ -1685,9 +1703,10 @@ pub const Find = struct { /// List the lines of the files below this pane's directory that hold its /// argument. /// -/// Find matches the files' names, Grep the lines of those files, on the disk -/// engine's worker. A query pane under this pane: bare (`SPC f g`) typed -/// into; with a word, listed. +/// The text is matched as it is, not as a pattern, in a query pane under this +/// pane, its line 1 `Grep `: with a word, listed, the keyboard left +/// where it was; bare (`SPC f g`), typed into. Past 2000 lines it stops, and +/// More goes on. A script's Grep that finds nothing fails, `not found`. pub const Grep = struct { pub const takes_arg = true; pub const requires_arg = true; @@ -1715,8 +1734,11 @@ fn search(c: Ctx, source: panes.Query.Source, miss: []const u8) void { /// Search in a query pane under this pane, its line 1 the argument. /// -/// Any of the query pane's words (`Search Panes`, `Search Symbols lay`, -/// `Search All needle`, `Search /re`); bare, `/`. +/// Line 1's first word names what it searches: `/re` this pane's text, +/// `Find`, `Grep`, `Recent`, `Panes`, `Symbols`, `All` (every open pane's +/// text), `Refs`, `Def`, `Impl`, `Diagnostics`; a line with none of them is a +/// `/`: `Search lay` is `/lay`. Bare, `/`, typed into. `SPC b b`, `SPC s s` +/// and `SPC /` open it with Panes, Symbols and All. pub const Search = struct { pub const takes_arg = true; pub const quiet = true; @@ -1727,7 +1749,7 @@ pub const Search = struct { } }; -/// A query pane's Grep stopped at its 2000 lines goes on for 2000 more. +/// Let a query pane's Grep stopped at its 2000 lines go on for 2000 more. pub const More = struct { pub const quiet = true; pub fn run(c: Ctx) void { @@ -1735,7 +1757,11 @@ pub const More = struct { } }; -/// Pick an open pane by its name in a query pane under this one (SPC b b). +/// Pick a pane by its name, in a query pane under this one. +/// +/// The open panes, then those closed this session, `(closed)`: Enter on one +/// goes to it, or brings a closed one back where it was, its text with it. +/// `Panes ` narrows them; `SPC b b` opens the same query. pub const Panes = struct { pub const takes_arg = true; pub const quiet = true; @@ -1891,7 +1917,11 @@ pub const Forward = struct { } }; -/// Select the next Look location across panes; Enter opens it. +/// Select the next thing a Look would open: a place in a list, a word that +/// names a file. +/// +/// The walk goes on through the panes in order, the keyboard with it; Enter +/// opens what it selected. pub const LookNext = struct { pub const quiet = true; pub fn run(c: Ctx) void { @@ -1899,7 +1929,9 @@ pub const LookNext = struct { } }; -/// Select the previous Look location across panes; Enter opens it. +/// Select the previous thing a Look would open, as LookNext walks forward. +/// +/// Enter opens what it selected. pub const LookPrev = struct { pub const quiet = true; pub fn run(c: Ctx) void { @@ -1924,7 +1956,11 @@ pub const Last = struct { } }; -/// List the files opened lately, closed ones too, each a place to open again. +/// List the files opened lately, closed ones too, in a query pane under this +/// one. +/// +/// `Recent ` narrows them by name; bare (`SPC f r`), typed into. Enter +/// opens the current one; B3 on a row, that one. pub const Recent = struct { pub const scope: Scope = .session; pub const takes_arg = true; diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json index 5f1ef67c..233588ae 100644 --- a/docs/typ/builtins-tui.json +++ b/docs/typ/builtins-tui.json @@ -36,14 +36,14 @@ {"name": "DumpDir", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": null, "doc": "The directory of the state file, where Dump writes and Recent is kept.", "text": "The directory of the state file, where Dump writes and Recent is kept. A relative Restore name is looked for there too; bare, the default."}, {"name": "DumpThemes", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Write the bundled themes into the config directory's themes, to edit.", "text": "Write the bundled themes into the config directory's themes, to edit."}, {"name": "Edit", "leader": null, "also": [], "arg": true, "scope": "both", "setting": false, "choices": null, "doc": "Run a command of sam's language over the open text panes, starting in this pane's body.", "text": "Run a command of sam's language over the open text panes, starting in this pane's body.\nAs acme's Edit: from a tag, a pane's ctl or an exec. One undo step in each file it changes; a failure changes nothing and says why."}, - {"name": "Exec", "leader": null, "also": ["tab", "middle-click"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Execute its argument as a middle click on it would, a builtin or a shell command.", "text": "Execute its argument as a middle click on it would, a builtin or a shell command."}, + {"name": "Exec", "leader": null, "also": ["tab", "middle-click"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Run its argument as B2 on it would: a builtin, else a shell command.", "text": "Run its argument as B2 on it would: a builtin, else a shell command.\n`Exec Newcol` runs the builtin. `Exec make test` runs the line: from a terminal at an idle, empty prompt, typed into its shell; from anywhere else, in a command pane (a terminal running `$SHELL -c` the line, which shows its output and `exit N` when it ends; Kill stops it). Run by name, a line is never a REPL's."}, {"name": "Exit", "leader": "SPC q", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Quit the editor; refused once while a pane holds unsaved text.", "text": "Quit the editor; refused once while a pane holds unsaved text.\nEach pane with unsaved text is listed in +Unsaved and the notice counts them; Exit again, nothing edited since, quits and discards it."}, {"name": "Filter", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Recolour a terminal's or a +Pager's program colours to the theme, or show them as sent.", "text": "Recolour a terminal's or a +Pager's program colours to the theme, or show them as sent.\nEach Filter flips between the two."}, - {"name": "Find", "leader": "SPC f f", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the files below this pane's directory whose names hold its argument, in a +Search.", "text": "List the files below this pane's directory whose names hold its argument, in a +Search."}, + {"name": "Find", "leader": "SPC f f", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the files below this pane's directory whose names match its argument.", "text": "List the files below this pane's directory whose names match its argument.\nA query pane under this pane, its line 1 `Find `, the files under it by a fuzzy match of their names: with a word, listed, the keyboard left where it was; bare (`SPC f f`), typed into. Enter or B3 on a row opens that file. A script's Find that finds nothing fails, `not found`."}, {"name": "Follow", "leader": "SPC c f", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Show one text across a chain of panes as consecutive pages, scrolled as one.", "text": "Show one text across a chain of panes as consecutive pages, scrolled as one.\nAs Emacs's follow-mode: each page goes on where the one before ends. Each Follow adds a page, a Zerox of the text, at the end of the column right of the chain's last, or in a new column there; its tag has Unfollow."}, {"name": "Forward", "leader": "SPC j i", "also": ["C-i"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Ctrl-i: one step forward again, up to wherever Back started.", "text": "Ctrl-i: one step forward again, up to wherever Back started."}, {"name": "Get", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "acme's Get: the pane's file read again, its unsaved edits refused once as Del refuses them.", "text": "acme's Get: the pane's file read again, its unsaved edits refused once as Del refuses them. `Get file` loads that file into the pane instead, the pane taking its name."}, - {"name": "Grep", "leader": "SPC f g", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the lines of the files below this pane's directory that hold its argument.", "text": "List the lines of the files below this pane's directory that hold its argument.\nFind matches the files' names, Grep the lines of those files, on the disk engine's worker. A query pane under this pane: bare (`SPC f g`) typed into; with a word, listed."}, + {"name": "Grep", "leader": "SPC f g", "also": ["topbar"], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "List the lines of the files below this pane's directory that hold its argument.", "text": "List the lines of the files below this pane's directory that hold its argument.\nThe text is matched as it is, not as a pattern, in a query pane under this pane, its line 1 `Grep `: with a word, listed, the keyboard left where it was; bare (`SPC f g`), typed into. Past 2000 lines it stops, and More goes on. A script's Grep that finds nothing fails, `not found`."}, {"name": "Help", "leader": "SPC ?", "also": ["topbar"], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Show every builtin with its keys and documentation, or one builtin's alone.", "text": "Show every builtin with its keys and documentation, or one builtin's alone.\n`Help `: that builtin alone, its keys spelled out, what it acts on and its line for a shell (`Help Diff`); a setting or an addon's word the same. `Help `: the builtins under SPC and those keys (`Help l`, as `SPC l ?` shows them). Each fills the one +Help: a second Help replaces its text."}, {"name": "History", "leader": "SPC f h", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "List the state file's dumps, newest first, each with the Restore that brings it back.", "text": "List the state file's dumps, newest first, each with the Restore that brings it back.\nThose Dump made and those every session's end left: each a `Restore