aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/face_coverage.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 18:10:38 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 18:10:38 -0400
commitfd1969eda49b2e6c562439ecea9430ace164e16d (patch)
treec4a9f3874987300845ec180758191d6e59beb163 /scripts/theme-studio/face_coverage.py
parent201a1174ce1e6004087fc53271deac7eac22555a (diff)
downloaddotemacs-fd1969eda49b2e6c562439ecea9430ace164e16d.tar.gz
dotemacs-fd1969eda49b2e6c562439ecea9430ace164e16d.zip
refactor(theme-studio): tier-1 simplification pass
These are behavior-preserving cleanups from the refactor/simplify assessment, all test-verified. I merged syncMockHeight and syncPkgHeight into one syncPaneHeight(tableId, paneId), inlined the two single-use displayHex/displayName closures, dropped a pkgbody guard that buildPkgTable already does, and had paintUI call worstCellHtml instead of rebuilding the covered-contrast cell. I deleted the dead generatorHues "manual" branch (a copy of the fallback) and locateInfoLine (orphaned when I removed the preview info line earlier today). The two nerd-icons loaders now share _load_nerd_icons_artifact, with a sentinel so a null-file edge keeps its exact behavior. face_coverage.classify reads through named locals now, guarded by a new characterization test. Two assessment findings were wrong and skipped after I checked them against the code: LOCATE_REG is live (read by previewSpan), and normalizePaletteEntryCore doesn't exist.
Diffstat (limited to 'scripts/theme-studio/face_coverage.py')
-rw-r--r--scripts/theme-studio/face_coverage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/theme-studio/face_coverage.py b/scripts/theme-studio/face_coverage.py
index c6200e05c..57b44815a 100644
--- a/scripts/theme-studio/face_coverage.py
+++ b/scripts/theme-studio/face_coverage.py
@@ -179,12 +179,12 @@ def classify(name, items, src, pkgfaces):
if name == 'emacs-core':
return 'core'
c = collections.Counter(bucket_of_source(src.get(f, '')) for f in items)
- loaded = c['elpa'] + c['builtin'] + c['user'] + c['other']
- if loaded == 0:
+ elpa, builtin, user, other = c['elpa'], c['builtin'], c['user'], c['other']
+ if elpa + builtin + user + other == 0:
return 'package' if any(f in pkgfaces for f in items) else 'general'
- if c['elpa'] >= max(c['builtin'], c['user'], c['other']):
+ if elpa >= max(builtin, user, other):
return 'package'
- if c['other'] > c['builtin'] and c['other'] >= c['elpa']:
+ if other > builtin and other >= elpa:
return 'package'
return 'general'