branch: externals/exwm
commit eab42b00593ffce1e616b5cd7cd0e60cc287189c
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
exwm-xsettings: Handle undefined background face color
* exwm-xsettings.el (exwm-xsettings--pick-theme): Ignore error when color is
undefined.
---
exwm-xsettings.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/exwm-xsettings.el b/exwm-xsettings.el
index 077b94a462..2d76a24513 100644
--- a/exwm-xsettings.el
+++ b/exwm-xsettings.el
@@ -132,7 +132,10 @@ the default face's background color."
(pcase theme
((cl-type string) theme)
(`(,(cl-type string) . ,(cl-type string))
- (if (color-dark-p (color-name-to-rgb (face-background 'default)))
+ ;; The background color can be undefined for terminal Emacs. This only
+ ;; happens rarely, e.g., when switching themes from a terminal frame, from
+ ;; the same instance as EXWM.
+ (if (ignore-errors (color-dark-p (color-name-to-rgb (face-background
'default))))
(cdr theme) (car theme)))
(_ (error "Expected theme to be a string or a pair of strings"))))