From 0801bf7fd35d4d37d2cba3c984622022cc1528fc Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 30 Jun 2026 10:39:52 -0400 Subject: feat(theme-studio): surface the five remaining font-lock faces Add the font-lock faces the syntax tier didn't cover (warning, doc-markup, negation-char, and the two regexp-grouping faces) as their own editable categories: warn, dmark, neg, rxgb, rxgc. Each maps 1:1 to its face, seeds from the stock defaults, and is exercised in the code-sample preview via a TODO comment, a docstring substitution, a string regexp, and a C negation. Injected only the five new faces into the default-faces snapshot rather than regenerating it wholesale. A full recapture pulls in unrelated package-inventory drift. --- scripts/theme-studio/capture-default-faces.py | 5 + scripts/theme-studio/emacs-default-faces.json | 203 ++++++++++++++++++++++++++ scripts/theme-studio/generate.py | 7 +- scripts/theme-studio/samples.py | 8 +- scripts/theme-studio/theme-studio.html | 4 +- 5 files changed, 221 insertions(+), 6 deletions(-) (limited to 'scripts/theme-studio') diff --git a/scripts/theme-studio/capture-default-faces.py b/scripts/theme-studio/capture-default-faces.py index a5214fd5a..b9104c9d7 100644 --- a/scripts/theme-studio/capture-default-faces.py +++ b/scripts/theme-studio/capture-default-faces.py @@ -52,6 +52,11 @@ SYNTAX = { "font-lock-delimiter-face", "font-lock-misc-punctuation-face", ], + "warn": ["font-lock-warning-face"], + "dmark": ["font-lock-doc-markup-face"], + "neg": ["font-lock-negation-char-face"], + "rxgb": ["font-lock-regexp-grouping-backslash"], + "rxgc": ["font-lock-regexp-grouping-construct"], } UI = [ diff --git a/scripts/theme-studio/emacs-default-faces.json b/scripts/theme-studio/emacs-default-faces.json index d68f6798e..2fe97a3f4 100644 --- a/scripts/theme-studio/emacs-default-faces.json +++ b/scripts/theme-studio/emacs-default-faces.json @@ -9217,6 +9217,45 @@ "underline": "nil", "weight": "normal" }, + "font-lock-doc-markup-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "font-lock-constant-face" + }, + "default-spec": [ + [ + "t", + ":inherit", + "font-lock-constant-face" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "LightGray", + "foregroundHex": "#d3d3d3", + "height": 1, + "inherit": "font-lock-constant-face", + "selectedInherits": [ + "font-lock-constant-face" + ], + "slant": "normal", + "strike": null, + "underline": "t", + "weight": "bold" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "font-lock-constant-face", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "t", + "weight": "bold" + }, "font-lock-escape-face": { "background": "unspecified-bg", "box": "nil", @@ -9617,6 +9656,38 @@ "underline": "nil", "weight": "normal" }, + "font-lock-negation-char-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": {}, + "default-spec": [ + [ + "t", + "nil" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "nil", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "normal" + }, "font-lock-number-face": { "background": "unspecified-bg", "box": "nil", @@ -9869,6 +9940,84 @@ "underline": "nil", "weight": "normal" }, + "font-lock-regexp-grouping-backslash": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "bold" + }, + "default-spec": [ + [ + "t", + ":inherit", + "bold" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "inherit": "bold", + "selectedInherits": [ + "bold" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "bold", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, + "font-lock-regexp-grouping-construct": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "bold" + }, + "default-spec": [ + [ + "t", + ":inherit", + "bold" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "black", + "foregroundHex": "#000000", + "height": 1, + "inherit": "bold", + "selectedInherits": [ + "bold" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "normal" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "bold", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, "font-lock-string-face": { "background": "unspecified-bg", "box": "nil", @@ -10384,6 +10533,45 @@ "underline": "nil", "weight": "bold" }, + "font-lock-warning-face": { + "background": "unspecified-bg", + "box": "nil", + "chosenGuiLight": { + "inherit": "error" + }, + "default-spec": [ + [ + "t", + ":inherit", + "error" + ] + ], + "effectiveGuiLight": { + "background": "white", + "backgroundHex": "#ffffff", + "box": null, + "foreground": "Red1", + "foregroundHex": "#ff0000", + "height": 1, + "inherit": "error", + "selectedInherits": [ + "error" + ], + "slant": "normal", + "strike": null, + "underline": null, + "weight": "bold" + }, + "exists": true, + "foreground": "unspecified-fg", + "height": 1, + "inherit": "error", + "overline": "nil", + "slant": "normal", + "strike": "nil", + "underline": "nil", + "weight": "bold" + }, "fringe": { "background": "gray", "box": "nil", @@ -34148,6 +34336,9 @@ "font-lock-constant-face" ], "dec": null, + "dmark": [ + "font-lock-doc-markup-face" + ], "doc": [ "font-lock-doc-face" ], @@ -34163,6 +34354,9 @@ "kw": [ "font-lock-keyword-face" ], + "neg": [ + "font-lock-negation-char-face" + ], "num": [ "font-lock-number-face" ], @@ -34188,6 +34382,12 @@ "re": [ "font-lock-regexp-face" ], + "rxgb": [ + "font-lock-regexp-grouping-backslash" + ], + "rxgc": [ + "font-lock-regexp-grouping-construct" + ], "str": [ "font-lock-string-face" ], @@ -34197,6 +34397,9 @@ "var": [ "font-lock-variable-name-face", "font-lock-variable-use-face" + ], + "warn": [ + "font-lock-warning-face" ] }, "ui-faces": [ diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py index e50d102de..dc6d0a8ef 100644 --- a/scripts/theme-studio/generate.py +++ b/scripts/theme-studio/generate.py @@ -312,9 +312,12 @@ CATS=[["bg","bg (ground)","Aa Bb 123"],["p","fg","other / whitespace"],["kw","ke ["ty","type / class","int str Order Queue"],["prop","property / field","id name items"], ["con","constant","None nil NULL true"],["num","number","8080 100 -1"], ["str","string",'"dupre" "fmt"'],["esc","escape","\\n \\t"],["re","regexp","/^#[0-9a-f]+/"], - ["doc","docstring",'"""..."""'],["cm","comment","# reject nil"],["cmd","comment delim","# // ;;"], + ["rxgb","regexp backslash","\\\\("],["rxgc","regexp construct","\\( \\)"], + ["doc","docstring",'"""..."""'],["dmark","doc mark","\\[cmd] `sym'"], + ["cm","comment","# reject nil"],["cmd","comment delim","# // ;;"], ["var","variable / use","value key self"],["op","operator",": = -> =="], - ["punc","punctuation","{ } ( ) ;"]] + ["neg","negation char","!"],["punc","punctuation","{ } ( ) ;"], + ["warn","warn","TODO FIXME"]] UI_FACES=[["cursor","cursor","Aa|"],["region","region (selection)","selected text"], ["hl-line","hl-line (current line)","current line"],["highlight","highlight","hover"], ["mode-line","mode-line","status active"], diff --git a/scripts/theme-studio/samples.py b/scripts/theme-studio/samples.py index 585fff04c..feebd1b71 100644 --- a/scripts/theme-studio/samples.py +++ b/scripts/theme-studio/samples.py @@ -43,6 +43,7 @@ PYS=[ ] ELS=[ [('cmd',';;'),('cm',' cache.el')], + [('cmd',';;'),('cm',' '),('warn','TODO'),('cm',': add an LRU eviction policy')], [('punc','('),('kw','require'),('p',' '),('con',"'cl-lib"),('punc',')')], [], [('punc','('),('kw','defvar'),('p',' '),('var','cache--tbl'),('p',' '),('punc','('),('fnc','make-hash-table'),('p',' '),('con',':test'),('p',' '),('con',"'equal"),('punc','))')], @@ -55,7 +56,7 @@ ELS=[ [('p',' '),('punc','('),('fnc','puthash'),('p',' '),('var','key'),('p',' '),('var','v'),('p',' '),('var','cache--tbl'),('punc',') '),('var','v'),('punc','))))')], [], [('punc','('),('kw','defun'),('p',' '),('fnd','cache-clear'),('p',' '),('punc','()')], - [('p',' '),('doc','"Empty the memo table."')], + [('p',' '),('doc','"Empty the memo table. See '),('dmark','\\\\[cache-get]'),('doc','."')], [('p',' '),('punc','('),('kw','interactive'),('punc',')')], [('p',' '),('punc','('),('fnc','clrhash'),('p',' '),('var','cache--tbl'),('punc',')')], [('p',' '),('punc','('),('fnc','message'),('p',' '),('str','"cleared'),('esc','\\n'),('str','"'),('punc','))')], @@ -66,6 +67,9 @@ ELS=[ [('p',' '),('punc','('),('fnc','maphash'),('p',' '),('punc','('),('kw','lambda'),('p',' '),('punc','('),('var','k'),('p',' '),('var','_v'),('punc',')'),('p',' '),('punc','('),('fnc','push'),('p',' '),('var','k'),('p',' '),('var','acc'),('punc','))')], [('p',' '),('var','cache--tbl'),('punc',')'),('p',' '),('var','acc'),('punc','))')], [], + [('punc','('),('kw','defun'),('p',' '),('fnd','cache--key-p'),('p',' '),('punc','('),('var','s'),('punc',')')], + [('p',' '),('punc','('),('fnc','string-match'),('p',' '),('str','"'),('rxgb','\\\\'),('rxgc','('),('str','key'),('rxgb','\\\\'),('rxgc',')'),('str','"'),('p',' '),('var','s'),('punc','))')], + [], [('punc','('),('kw','provide'),('p',' '),('con',"'cache"),('punc',')')], ] GOS=[ @@ -134,7 +138,7 @@ CS=[ [], [('cmd','//'),('cm',' returns -1 on null input')], [('ty','int'),('p',' '),('fnd','push'),('punc','('),('ty','Order'),('p',' '),('op','*'),('var','o'),('punc',')'),('p',' '),('dec','__attribute__'),('punc','(('),('dec','nonnull'),('punc','))'),('p',' '),('punc','{')], - [('p',' '),('kw','if'),('p',' '),('punc','('),('var','o'),('p',' '),('op','=='),('p',' '),('con','NULL'),('punc',')'),('p',' '),('kw','return'),('p',' '),('num','-1'),('punc',';')], + [('p',' '),('kw','if'),('p',' '),('punc','('),('neg','!'),('var','o'),('punc',')'),('p',' '),('kw','return'),('p',' '),('num','-1'),('punc',';')], [('p',' '),('fnc','printf'),('punc','('),('str','"id=%d'),('esc','\\n'),('str','"'),('punc',','),('p',' '),('var','o'),('op','->'),('prop','id'),('punc',');')], [('p',' '),('kw','return'),('p',' '),('num','0'),('punc',';')], [('punc','}')], diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html index 85145fb28..3b8d4b90e 100644 --- a/scripts/theme-studio/theme-studio.html +++ b/scripts/theme-studio/theme-studio.html @@ -297,10 +297,10 @@