aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 11:54:39 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 11:54:39 -0500
commit32cfe216b4f5917b1a979e0372edf9b8f1ab62ea (patch)
tree7fe70b4d8a120dd8402d19faa3546f388d8e17cf /tests
parent56da3d940b26a51102bce39b3b82dfbbc2b391fd (diff)
downloaddotemacs-32cfe216b4f5917b1a979e0372edf9b8f1ab62ea.tar.gz
dotemacs-32cfe216b4f5917b1a979e0372edf9b8f1ab62ea.zip
fix(theme): register dupre faces so org status colors are themed
The dupre theme defined its own faces (dupre-accent, the headings, and the org status faces) only through custom-theme-set-faces, never defface. That leaves them unregistered, so they render through :inherit but silently fail when applied directly as a text property. org-todo-keyword-faces and org-priority-faces apply faces that way, so the org keyword and priority colors never showed as dupre tones. I added a defface registration block to dupre-faces.el for all of dupre's own faces, so they're real faces. The theme still sets their colors. Then I pointed org-todo-keyword-faces and org-priority-faces (in org-config.el) at named dupre-org-* faces, each the closest palette color to its former hard-coded name, and gave each a dimmed variant that auto-dim-config.el swaps in for unfocused windows. A keyword in a dimmed window now shows a darker shade of its own color rather than flat gray or full brightness. A regression test asserts dupre's faces stay registered, since that was the latent bug behind all of this.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-dupre-theme.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test-dupre-theme.el b/tests/test-dupre-theme.el
index 32fa437e..dec648d1 100644
--- a/tests/test-dupre-theme.el
+++ b/tests/test-dupre-theme.el
@@ -204,5 +204,24 @@
(load-theme 'dupre t)
(should (string= (face-attribute 'success :foreground) "#a4ac64")))
+;;; Face registration
+
+(ert-deftest dupre-semantic-faces-are-registered ()
+ "Dupre's own faces must be real faces, not just theme specs.
+An unregistered face renders only through `:inherit'; applied directly as
+a text property (e.g. via `org-todo-keyword-faces') it silently fails.
+The defface registration in dupre-faces.el is what makes direct use work."
+ (load-theme 'dupre t)
+ (dolist (face '(dupre-accent dupre-heading-1
+ dupre-org-todo dupre-org-todo-dim
+ dupre-org-failed dupre-org-priority-a
+ dupre-org-priority-a-dim))
+ (should (facep face)))
+ ;; and the theme colours them from the palette
+ (should (string= (face-attribute 'dupre-org-todo :foreground nil 'default)
+ "#a4ac64"))
+ (should (string= (face-attribute 'dupre-org-todo-dim :foreground nil 'default)
+ "#869038")))
+
(provide 'test-dupre-theme)
;;; test-dupre-theme.el ends here