From b0ca38bc98f240e208edd08009856ab6de62c227 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 11 Jul 2026 23:52:49 -0500 Subject: refactor(gallery): rename generated tokens.el to gallery-tokens.el The generated file declares (provide 'gallery-tokens), but `require` resolves a feature by filename, so as tokens.el it could never load from a load-path. The name now matches the feature. gen_tokens.py, the renderer's load, and the README follow. --- tests/gallery-tokens/test_gen_tokens.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/gallery-tokens') diff --git a/tests/gallery-tokens/test_gen_tokens.py b/tests/gallery-tokens/test_gen_tokens.py index 414194e..b9fbb50 100644 --- a/tests/gallery-tokens/test_gen_tokens.py +++ b/tests/gallery-tokens/test_gen_tokens.py @@ -210,6 +210,16 @@ class RealTokensJson(unittest.TestCase): self.assertIn("pulse-rate", self.tokens["timing"]) +class DefaultElispFilename(unittest.TestCase): + """The default elisp target must be gallery-tokens.el so that the file's + (provide 'gallery-tokens) matches its name and `require` can resolve it + from a load-path. A tokens.el/gallery-tokens feature mismatch is a trap.""" + + def test_default_elisp_path_matches_provided_feature(self): + self.assertEqual( + os.path.basename(gt.DEFAULT_ELISP_NAME), "gallery-tokens.el") + + class MainIntegration(unittest.TestCase): """main() rewrites the html :root and writes the waybar + elisp files.""" @@ -218,7 +228,7 @@ class MainIntegration(unittest.TestCase): self.html = os.path.join(self.tmp, "gallery.html") self.tokens_path = os.path.join(self.tmp, "tokens.json") self.waybar = os.path.join(self.tmp, "tokens-waybar.css") - self.elisp = os.path.join(self.tmp, "tokens.el") + self.elisp = os.path.join(self.tmp, "gallery-tokens.el") with open(self.tokens_path, "w") as f: json.dump(FIXTURE, f) with open(self.html, "w") as f: -- cgit v1.2.3