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. --- README.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index 658c4ed..82b36b4 100644 --- a/README.org +++ b/README.org @@ -293,6 +293,23 @@ The default lookup provider is =ipapi.co=. Two alternatives ship with the packag *Note:* IP-based geolocation can be wrong when you are behind a VPN or using a mobile hotspot. The confirmation prompt lets you reject an inaccurate result. If you prefer, set =wttrin-favorite-location= directly to any city string that wttr.in understands. +*** Theming the Faces +The text wttrin draws itself uses named faces, so themes and =M-x customize-face= can restyle it. (The weather art itself is colored by the ANSI codes wttr.in returns, not by these faces.) + +| Face | Styles | Default | +|---------------------------+------------------------------------------------------+-------------------| +| =wttrin-mode-line-stale= | the mode-line emoji when its data has gone stale | inherits =shadow= | +| =wttrin-staleness-header= | the "Last updated: ..." line in the weather buffer | inherits =shadow= | +| =wttrin-instructions= | the key-hint footer prose in the weather buffer | inherits =shadow= | +| =wttrin-key= | the bracketed key chords ([a] [g] [q]) in the footer | inherits =bold= | + +Restyle them in your init file like any other face: + +#+begin_src emacs-lisp + (set-face-attribute 'wttrin-key nil :foreground "deep sky blue" :weight 'bold) + (set-face-attribute 'wttrin-staleness-header nil :slant 'italic) +#+end_src + ** Debugging and Troubleshooting If something isn't working, debug mode logs every fetch, every display update, and every error. -- cgit v1.2.3