diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-19 00:47:19 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-19 00:47:19 -0500 |
| commit | 71c52505f074580134e39e914287f7b3a92978dc (patch) | |
| tree | 08ce4898a06e2cc711ebfbc13d1c5c2abbfc2b97 /scripts/theme-studio/test_generate.py | |
| parent | 3e2adc828860075e205d4b43c0b17fd8d448459b (diff) | |
| download | dotemacs-71c52505f074580134e39e914287f7b3a92978dc.tar.gz dotemacs-71c52505f074580134e39e914287f7b3a92978dc.zip | |
feat(theme-studio): seed faces with their default distant-fg, overline, inverse, and extend
The studio now pre-fills the additive attributes a face carries in stock Emacs, so it opens closer to reality. default_faces.seed reads distant-foreground, overline, inverse-video, and extend from the captured snapshot, the same way it already reads weight, slant, underline, and strike. lazy-highlight, for example, opens with its black distant-foreground instead of blank, and the faces that extend to the window edge open with that flag set.
The capture script gains overline in its attribute map and probe, so the next snapshot refresh records it too. I didn't re-run the capture here. distant-fg, inverse-video, and extend are already in the committed snapshot, so reading them seeds every face that has them, and stock faces almost never set overline. A fresh capture (python3 scripts/theme-studio/capture-default-faces.py) is a larger, separate refresh, since the new probe field touches all 687 face blocks.
Imported presets are unaffected, since they carry their own face data and never re-read the snapshot. Only a fresh studio session sees the richer seeds. Full suite green: Python 61, Node 201, ERT 41, plus the browser hash gates.
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
| -rw-r--r-- | scripts/theme-studio/test_generate.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index e20e90b3e..125f0c9ab 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -421,6 +421,16 @@ class DefaultFaceAdapter(unittest.TestCase): }, "effectiveGuiLight": {}, }, + "rich": { + "chosenGuiLight": { + "distantForeground": "black", + "distantForegroundHex": "#000000", + "overline": "t", + "inverseVideo": "t", + "extend": "t", + }, + "effectiveGuiLight": {}, + }, } }) @@ -435,6 +445,19 @@ class DefaultFaceAdapter(unittest.TestCase): "box": {"style": "released", "width": 2, "color": None}, }) + def test_seed_emits_the_additive_attrs_when_the_snapshot_has_them(self): + self.assertEqual(self.defaults.seed("rich", effective=False), { + "distant-fg": "#000000", + "overline": {"color": None}, + "inverse": True, + "extend": True, + }) + + def test_seed_omits_additive_attrs_when_the_snapshot_lacks_them(self): + seeded = self.defaults.seed("sample", effective=False) + for key in ("distant-fg", "overline", "inverse", "extend"): + self.assertNotIn(key, seeded) + def test_color_reads_effective_hex_by_default(self): self.assertEqual(self.defaults.color("sample"), "#000000") |
