Skip to content

feat: optional Acme Look/Execute, and :pending-task - #15

Merged
nooga merged 6 commits into
mainfrom
acme-look-rebased
Sep 18, 2026
Merged

nooga merged 6 commits into
mainfrom
acme-look-rebased

Conversation

@nooga

@nooga nooga commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

Supersedes #3.

Test plan

  • lg test/run.lg (322 tests, 1395 assertions)
  • F8 on a path / directory listing; F7 on a token; +Errors buffer reuses
  • A slow Execute shows Execute: running ... before output appears

Made with Cursor

dharmatech and others added 6 commits September 18, 2026 23:20
The Acme branch changed buffer-label to prefer :buffer-name over
:filename -- a good fix (generated buffers like *Help* and *repl* were
all reading as "*scratch*" in that segment), but a global mode-line
change with no coverage of its own, and modeline.lg had no test file at
all.

Pins the precedence rule (:buffer-name > :filename > "*scratch*") plus
the modified-marker/color pairing, and the registry contract around it
(register/reorder/remove, and nil-or-empty segments dropping out of the
frame), so the change stands independently of the Acme feature.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both ops were open-coding the same find-buffer-by-:buffer-name scan over
:order, then the same focus-or-add-buffer branch. Factored into
find-buffer-by-name plus reuse-named-buffer, leaving the reuse policy --
replace the content (:help regenerates help text) or append to it
(:append-named accumulates output blocks) -- as the only difference, passed
in as a named fn.

replaced-buffer-state is a top-level fn rather than an inline (fn [_ x] x)
at the :help call site: an fn literal inside a case branch is the shape
CLAUDE.md warns about for let-go's AOT closure hoisting, and there's no
reason to sail close to it. Verified with ./build.sh -- 524 fns lowered,
no empty-if-then-return-closure pattern anywhere in build/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
execute-at-point called os/sh inline, so the whole rc run happened
between the keystroke and the next frame: the screen sat on the state
from *before* the key was pressed, with nothing saying why. Same shape
as the existing M-! shell-command, but F7 invites longer commands.

Adds the workspace-shared :pending-task field for exactly the thing a
pure (fn [state] -> state) command can't say: "do this slow thing, but
let the screen catch up first." A command returns a message plus a task;
main.lg's loop paints that frame and then runs the task in place of
reading a key. The task is itself a (fn [state] -> state) threaded
through the same bufs/put-current fold, so it can set a :buffer-command,
and dropping the field from the flat state is what consumes it -- a task
may arm a further task, which is the seam an actual async job model
would grow from (poll a running process across iterations without any
layer below main.lg learning what a process is).

execute-at-point now shows "Execute: running <cmd> ..." while rc runs.
It still runs to completion before the next key is read; this only fixes
the frozen-frame half, which is the visible half.

execute-task is a named fn building the closure so execute-at-point's
if-let branch contains a call, not an fn literal -- the CLAUDE.md AOT
hazard. Tested via ./build.sh; lowers cleanly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A command that has to block (Acme Execute, vibe, anything later) arms
the same shared field rather than growing a per-feature hook in main.lg.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nooga
nooga merged commit db8963a into main Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants