branch: externals/indent-bars
commit 7e3f5fe26edcc71b392543ba1d05d408b3f1de40
Author: JD Smith <[email protected]>
Commit: JD Smith <[email protected]>
Handle both face and property list default face remaps
Note that only a single face or property list is evaluated, and the
base face is assumed to be `default'. Emacs could really use an API
to query the attributes for a given remap face.
---
indent-bars.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/indent-bars.el b/indent-bars.el
index d8be7e33b5..2b4cc9c1b6 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -532,14 +532,16 @@ NO-REMAP is passed to `indent-bars--background-color'."
"Return the background color in the current buffer/frame.
Unless NO-REMAP is non-nil, if the background comes from remapping,
return (REMAP . COLOR). Otherwise ignore remapping."
- (let ((remap-face (and (null no-remap)
- (car (alist-get 'default face-remapping-alist))))
+ (let ((remap-face (and (not no-remap)
+ (ensure-list
+ (car (alist-get 'default face-remapping-alist)))))
(fb (frame-parameter nil 'background-color)) bg)
(cond
((and remap-face
(let ((temp-face (make-symbol "temp-face")))
;; we must handle anonymous face remappings, like (:background
"yellow")
- (face-spec-set temp-face `((t . ,remap-face)) 'face-defface-spec)
+ ;; Note that only the first (list or face) on the remap is handled
+ (face-spec-set temp-face `((t ,remap-face)) 'face-defface-spec)
(setq bg (face-background temp-face nil t))))
(cons 'remap bg))
((not fb) "white")