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--add-buffer-instructions.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/test-wttrin--add-buffer-instructions.el') diff --git a/tests/test-wttrin--add-buffer-instructions.el b/tests/test-wttrin--add-buffer-instructions.el index 4949c45..0f1c382 100644 --- a/tests/test-wttrin--add-buffer-instructions.el +++ b/tests/test-wttrin--add-buffer-instructions.el @@ -73,6 +73,24 @@ (setq count (1+ count)))) (should (= 2 count)))))) +(ert-deftest test-wttrin--add-buffer-instructions-normal-key-chords-carry-key-face () + "Bracketed key chords are styled with `wttrin-key'." + (with-temp-buffer + (wttrin--add-buffer-instructions) + (goto-char (point-min)) + (search-forward "[a]") + ;; point is just after the closing bracket; the bracket char is part + ;; of the "[a]" segment + (should (eq (get-text-property (1- (point)) 'face) 'wttrin-key)))) + +(ert-deftest test-wttrin--add-buffer-instructions-normal-prose-carries-instructions-face () + "The footer prose is styled with `wttrin-instructions'." + (with-temp-buffer + (wttrin--add-buffer-instructions) + (goto-char (point-min)) + (search-forward "Press:") + (should (eq (get-text-property (1- (point)) 'face) 'wttrin-instructions)))) + ;;; Boundary Cases (ert-deftest test-wttrin--add-buffer-instructions-boundary-point-at-beginning-appends-at-end () -- cgit v1.2.3