summaryrefslogtreecommitdiff
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-12-20 20:42:57 +0000
committerRichard M. Stallman <rms@gnu.org>1994-12-20 20:42:57 +0000
commitc8157002eb43f7493d9bcc68eaad604ffd34c295 (patch)
treea8d8548242d6ca9a72203cd6dcf887fb6f8dec51 /lisp/faces.el
parent2fb103eeec126459dd59f656203864c6c35b26d9 (diff)
downloademacs-c8157002eb43f7493d9bcc68eaad604ffd34c295.tar.gz
(frame-update-face-colors): New function.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 289e63267eb..8b0741658ff 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -953,6 +953,38 @@ selected frame."
(setq rest (cdr rest)))
frame)))
+;; Update the colors of FACE, after FRAME's own colors have been changed.
+;; This applies only to faces with global color specifications
+;; that are not simple constants.
+(defun frame-update-face-colors (frame)
+ (let ((faces global-face-data))
+ (while faces
+ (condition-case nil
+ (let* ((data (cdr (car faces)))
+ (face (car (car faces)))
+ (foreground (face-foreground data))
+ (background (face-background data)))
+ ;; If the global spec is a specific color,
+ ;; which doesn't depend on the frame's attributes,
+ ;; we don't need to recalculate it now.
+ (or (listp foreground)
+ (setq foreground nil))
+ (or (listp background)
+ (setq background nil))
+ ;; If we are going to frob this face at all,
+ ;; reinitialize it first.
+ (if (or foreground background)
+ (progn (set-face-foreground face nil frame)
+ (set-face-background face nil frame)))
+ (if foreground
+ (face-try-color-list 'set-face-foreground
+ face foreground frame))
+ (if background
+ (face-try-color-list 'set-face-background
+ face background frame)))
+ (error nil))
+ (setq faces (cdr faces)))))
+
;; Fill in the face FACE from frame-independent face data DATA.
;; DATA should be the non-frame-specific ("global") face vector
;; for the face. FACE should be a face name or face object.