summaryrefslogtreecommitdiff
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-11-24 13:16:13 +0000
committerGerd Moellmann <gerd@gnu.org>2000-11-24 13:16:13 +0000
commit9b9c74614fe731cd42af4f8bd74b1d10261146af (patch)
tree69098ca76df5d0399d84ea0491f5859bd9ec3d96 /lisp/faces.el
parentc97bb1f4f14893cc44a5fd9125e58a8332ed90a2 (diff)
downloademacs-9b9c74614fe731cd42af4f8bd74b1d10261146af.tar.gz
(face-set-after-frame-default): Let face attributes
specified for new frames override frame parameters.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 1f86b0c0075..bcf2b8ffdaf 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1488,14 +1488,16 @@ Initialize colors of certain faces from frame parameters."
(scroll-bar-foreground scroll-bar :foreground)
(scroll-bar-background scroll-bar :background)
(mouse-color mouse :background))))
- (while params
- (let ((param-name (nth 0 (car params)))
- (face (nth 1 (car params)))
- (attr (nth 2 (car params)))
- value)
- (when (setq value (frame-parameter frame param-name))
- (set-face-attribute face frame attr value)))
- (setq params (cdr params)))))
+ (dolist (param params)
+ (let ((frame-param (frame-parameter frame (nth 0 param)))
+ (face (nth 1 param))
+ (attr (nth 2 param)))
+ (when (and frame-param
+ ;; Don't override face attributes explicitly
+ ;; specified for new frames.
+ (eq (face-attribute face attr t) 'unspecified))
+ (set-face-attribute face frame attr frame-param))))))
+
(defun tty-handle-reverse-video (frame parameters)
"Handle the reverse-video frame parameter for terminal frames."