From 4d46eafaa087f5570ece9d2e5f5d2ba6bc0d824e Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 23 Jun 2026 23:04:46 -0400 Subject: feat: expose themeable faces for mode-line and buffer text I added four customizable faces so themes and customize-face can restyle the text wttrin draws itself: wttrin-mode-line-stale (the dimmed stale mode-line emoji), wttrin-staleness-header (the "Last updated:" line), wttrin-instructions (the footer prose), and wttrin-key (the [a]/[g]/[q] chords). The package exposed no faces before and hardcoded one color. The stale-emoji dimming used a literal "gray60". Now it inherits a face, so the color tracks the theme. I changed make-emoji-icon's second argument from a color string to a face symbol applied via :inherit. wttrin-key inherits bold rather than help-key-binding, which is Emacs 28+ while the package supports 24.4. The weather ASCII art stays colored by xterm-color's ANSI faces. Only the package's own text is newly faced. --- tests/test-wttrin-faces.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/test-wttrin-faces.el (limited to 'tests/test-wttrin-faces.el') diff --git a/tests/test-wttrin-faces.el b/tests/test-wttrin-faces.el new file mode 100644 index 0000000..db30002 --- /dev/null +++ b/tests/test-wttrin-faces.el @@ -0,0 +1,26 @@ +;;; test-wttrin-faces.el --- Tests for wttrin themeable faces -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Craig Jennings + +;;; Commentary: + +;; Unit tests verifying the package's customizable faces are defined so +;; themes and `customize-face' can target them. + +;;; Code: + +(require 'ert) +(require 'wttrin) + +;;; Normal Cases + +(ert-deftest test-wttrin-faces-normal-all-defined () + "Normal: every package face is defined after loading wttrin." + (dolist (face '(wttrin-mode-line-stale + wttrin-staleness-header + wttrin-instructions + wttrin-key)) + (should (facep face)))) + +(provide 'test-wttrin-faces) +;;; test-wttrin-faces.el ends here -- cgit v1.2.3