diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-09 09:41:28 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-09 09:41:28 -0500 |
| commit | 126a4e977cbde3b4e91823cd1ea126d054a51be1 (patch) | |
| tree | 43c219adb577812e769c5d81858f43f90312883e /scripts/theme-studio/generate.py | |
| parent | ce3f50e09518367e5d69b304e305e7fe7ed2298c (diff) | |
| download | dotemacs-126a4e977cbde3b4e91823cd1ea126d054a51be1.tar.gz dotemacs-126a4e977cbde3b4e91823cd1ea126d054a51be1.zip | |
fix(theme-studio): make the live buffer preview render UI faces the way Emacs does
The mock buffer rendered several faces wrong, verified against the running daemon and emacs -Q:
- highlight was flat monochrome text. Like region, the highlight face is background-only, so Emacs lets the syntax foreground show through (face merge: highlight over a keyword keeps the keyword color, adds the highlight background). Both now go through one overlay helper that keeps token colors and only overrides the foreground when the face sets one.
- cursor was an empty block at end-of-line. Emacs draws a box cursor on the character at point, in the frame background over the cursor color — now it sits on a real glyph.
- the overlay faces, the line-number gutter, and the paren faces ignored weight/underline/etc. They now honor bold/italic/underline/strike, matching the table preview.
- the fringe showed only its background. It now draws a continuation indicator in the fringe foreground.
- the mode line had no box. It now carries the 3D released-button box that is the Emacs default.
Defaults seeded to the theme-independent Emacs core styles (from emacs -Q): error/warning/success are bold; lazy-highlight and show-paren-match are underlined (link already was).
Added a #mocktest gate pinning these — overlay faces keep token colors, the cursor is on a glyph, styles render, the fringe indicator is present, the mode line has its box. Verified it goes red when the rendering regresses.
Diffstat (limited to 'scripts/theme-studio/generate.py')
| -rw-r--r-- | scripts/theme-studio/generate.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py index 56aa5800..29a2ebac 100644 --- a/scripts/theme-studio/generate.py +++ b/scripts/theme-studio/generate.py @@ -88,8 +88,12 @@ if _seed: if _d.get('ui'): for _k,_v in _d['ui'].items(): UIMAP[_k]=_v if 'locks' in _d: LOCKS=_d['locks'] -# link is underlined by default (matches the built-in link face). +# These faces carry a fixed style in Emacs's built-in definitions (verified with +# emacs -Q), independent of any theme: link / lazy-highlight / show-paren-match +# are underlined; error / warning / success are bold. Seed the defaults to match. UIMAP["link"]["underline"]=True +for _f in ("lazy-highlight","show-paren-match"): UIMAP[_f]["underline"]=True +for _f in ("error","warning","success"): UIMAP[_f]["bold"]=True # Tier-3 package faces (Phase 2): complete own-defface sets for org/magit/elfeed, # built from face-name lists + a curated seed-color map. Prominent faces are # seeded; the long tail seeds to the default foreground for the user to tune. |
