From 77b22e7c7623696feb52292bb86839870e20050d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 26 Nov 2026 04:37:03 -0300 Subject: themes, vendor, colors, gen_themes, exec, ctl, dump: DESIGN.md E's 44 themes retired, each name standing for its successor wherever it is still read (the themes programme's L7; DESIGN.md E, F): GONE: 28 helix sources (base16_default_light, base16_terminal, base16_transparent, bogster_light, cyan_light, eldritch_transparent, gruvbox-material, hex_lavender, hex_poison, ingrid, iroaseta, nord_light, nyxvamp-transparent, peachpuff, the six helix seoul256s, term16_dark, term16_light, tokyonight, ttox, ttox_soft, vesper-transparent, zed_onedark, zed_onelight), zed's ayu.json and gruvbox.json (every variant in them retired: ayu_dark/light/mirage_zed, the six gruvbox_*_zed) and their licences (ayu.LICENSE, gruvbox.LICENSE: zed's, covering those files alone; helix's licences each cover a kept theme), seoul256's 238, 239, 252 and 253 (their rows, their citations, their lines in its G4 block); vendor/themes/base/ holds the retired three kept themes inherit from (ayu_dark_helix, hex_steel, nord_helix; the designer's list named seven, but no kept theme inherits seoul256_dark/_light, term16_dark or zed_onedark once their children retire), passed to the generator as `base=` (build/core.zig `vendoredThemes` per directory), read for `inherits`, never rung; THE SUCCESSORS: `colors.retired`, 44 names and the kept one each stands for (the kept twin, the nearest kept seoul256 step, dark or light for the terminal-colour themes, the default where there is none: ingrid), read by `successorOf`: a `Theme` (an init file's line, a click, a /ctl write) naming one wears its successor and says so once, as a notice: "Theme gruvbox_dark_zed was retired: gruvbox instead" (exec.applySettingBuiltin); /ctl takes such a write (ctl.zig); a dump or Restore naming one restores its successor (`colors.restoredIndex`, dump.zig's two readers, which said the same loop twice; one this build has nothing of keeps the theme in effect as before, else the default by name, where it was index 0, dark's now); an unknown name keeps today's path and words; THE RING TEST'S LIST: empty, so gone (`ring_expected` and its bookkeeping: every theme in the ring passes every floor it is held to, or the test names it); RUN (TEST FIRST): colors.zig "a retired theme's name stands for its successor in an init file and a dump, said once; an unknown one leaves the default, in today's words" (an init `Theme gruvbox_dark_zed`, `Theme TTOX` (any case), `Theme ingrid` and `Theme no-such-theme`: gruvbox, dark, orchard and orchard, each with its one message; a dump of a session in acme with `ttox` put in for its theme's name, as an older build's: restored in dark): fails on L5 (gruvbox_dark_zed still in the ring, worn as itself), passes now; "every retired theme's successor is in the ring, and no retired name is" (44); the ring test: 245 of 245 themes pass every floor (289 at L5, 44 retired); "seoul256's eight backgrounds ring in their order"; the G4 test holds every port's file; core-test 1142/1315 (173 skipped: L5's 1140/1313 + the two retirement tests); OUTSIDE my files: build/core.zig (`vendoredThemes` per directory, the base arguments), core/exec.zig (`Theme`'s retired branch, 7 lines), core/ninep/ctl.zig (1 line), core/dump.zig (its two readers, `restoredIndex`); the dump's bytes and layout unchanged and a name in this build's ring restored as before (restoredIndex's first loop is the old one), so a join or a restore within a build never reaches the new branches: no fuzz or soak Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE --- tools/gen_themes.zig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/gen_themes.zig b/tools/gen_themes.zig index 62aafcf5..79a23a19 100644 --- a/tools/gen_themes.zig +++ b/tools/gen_themes.zig @@ -25,7 +25,9 @@ //! acme of its own; the file is otherwise untouched. So are `monokai`, //! `ayu_dark` and `nord` as `_helix.toml`, kept (unlike helix's other //! copies of themes ported here) because helix themes inherit them; those -//! `inherits` lines name the renamed file. Two themes answering to +//! `inherits` lines name the renamed file. A retired theme a kept one +//! inherits from (ayu_dark_helix, hex_steel, nord_helix: DESIGN.md E) sits in +//! vendor/themes/base/, passed as `base=`: read, never rung. Two themes answering to //! one name is a bug (`Theme ` would silently pick one), so core/colors.zig //! asserts the ring's names are distinct at comptime. //! @@ -103,12 +105,16 @@ pub fn main(init: std.process.Init) !void { // and the parent may be later in argv (or inherit something itself). var tomls: std.StringHashMapUnmanaged(Toml) = .empty; var stems: std.ArrayList([]const u8) = .empty; - for (args[2..]) |src| { + for (args[2..]) |arg| { + // `base=` a retired theme kept themes inherit from: read, never rung + // (vendor/themes/base/) + const base = std.mem.startsWith(u8, arg, "base="); + const src = if (base) arg["base=".len..] else arg; const text = try std.Io.Dir.cwd().readFileAlloc(io, src, arena, .limited(8 << 20)); if (std.mem.endsWith(u8, src, ".toml")) { const stem = std.fs.path.stem(src); try tomls.put(arena, stem, parseToml(arena, src, text)); - try stems.append(arena, stem); + if (!base) try stems.append(arena, stem); } else if (std.mem.endsWith(u8, src, ".json")) { try readZed(arena, gpa, src, text, &themes); } else { -- cgit v1.3