diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-20 17:38:27 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-20 17:38:27 -0400 |
| commit | 3ebf0e0f33ff0102121f37c1e102f9721202ccd6 (patch) | |
| tree | 91f92178778c56cd94c2ce58c5c49335f0c1417e /scripts/theme-studio/emacs-default-faces.json | |
| parent | 7f3932ef6adfb817e0f4b5bcfebd6b4eb54f5372 (diff) | |
| download | dotemacs-3ebf0e0f33ff0102121f37c1e102f9721202ccd6.tar.gz dotemacs-3ebf0e0f33ff0102121f37c1e102f9721202ccd6.zip | |
refactor(theme-studio): restore studio state after mutating gates via withSavedState
Seven gates (locktest, mocktest, gallerytest, safetest, ndtest, viewlocktest,
expandpersisttest) mutated PALETTE/MAP/SYNTAX/UIMAP/PKGMAP/LOCKED and restored
nothing, so opening the studio at one of those #hashes left its state corrupted
for interactive use. Wrap each in withSavedState(keys, body), scoped to the keys
that gate touches: snapshot the named globals, run the body, restore in a finally.
Uses a JSON-round-trip clone (the studio objects carry values structuredClone
throws on — the same clone the gates' own local saves use). The 14 gates that
already restore locally are left as-is. Verified: all 44 gates green, the restore
round-trip holds for reassignment + in-place + Set mutation, and a forced
assertion in a wrapped gate still reports FAIL.
Diffstat (limited to 'scripts/theme-studio/emacs-default-faces.json')
0 files changed, 0 insertions, 0 deletions
