aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wttrin.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/wttrin.el b/wttrin.el
index d09a64a..0f84f7a 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -597,12 +597,15 @@ user's original casing so tooltips display what the user expects."
(defun wttrin--make-emoji-icon (emoji &optional foreground)
"Create EMOJI string with optional font face and FOREGROUND color.
-Uses `wttrin-mode-line-emoji-font' when configured."
+Uses `wttrin-mode-line-emoji-font' when configured.
+Omits `:foreground' from the face plist when FOREGROUND is nil — a literal
+`:foreground nil' entry triggers \"Invalid face attribute\" warnings on every
+redisplay."
(if wttrin-mode-line-emoji-font
(propertize emoji
- 'face (list :family wttrin-mode-line-emoji-font
- :height 1.0
- :foreground foreground))
+ 'face `(:family ,wttrin-mode-line-emoji-font
+ :height 1.0
+ ,@(when foreground (list :foreground foreground))))
(if foreground
(propertize emoji 'face (list :foreground foreground))
emoji)))