aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-20 20:42:57 +0000
committerRichard M. Stallman1994-12-20 20:42:57 +0000
commitf16c38ae778618b7ce14b46caab069df938e4e2a (patch)
tree12efd224d93d5cfada7fcac4780f661bbf8d0475
parent1787c22a784282be4b772005ac0e269b7eeb6eee (diff)
downloademacs-f16c38ae778618b7ce14b46caab069df938e4e2a.tar.gz
emacs-f16c38ae778618b7ce14b46caab069df938e4e2a.zip
(frame-update-face-colors): New function.
-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."
953 (setq rest (cdr rest))) 953 (setq rest (cdr rest)))
954 frame))) 954 frame)))
955 955
956;; Update the colors of FACE, after FRAME's own colors have been changed.
957;; This applies only to faces with global color specifications
958;; that are not simple constants.
959(defun frame-update-face-colors (frame)
960 (let ((faces global-face-data))
961 (while faces
962 (condition-case nil
963 (let* ((data (cdr (car faces)))
964 (face (car (car faces)))
965 (foreground (face-foreground data))
966 (background (face-background data)))
967 ;; If the global spec is a specific color,
968 ;; which doesn't depend on the frame's attributes,
969 ;; we don't need to recalculate it now.
970 (or (listp foreground)
971 (setq foreground nil))
972 (or (listp background)
973 (setq background nil))
974 ;; If we are going to frob this face at all,
975 ;; reinitialize it first.
976 (if (or foreground background)
977 (progn (set-face-foreground face nil frame)
978 (set-face-background face nil frame)))
979 (if foreground
980 (face-try-color-list 'set-face-foreground
981 face foreground frame))
982 (if background
983 (face-try-color-list 'set-face-background
984 face background frame)))
985 (error nil))
986 (setq faces (cdr faces)))))
987
956;; Fill in the face FACE from frame-independent face data DATA. 988;; Fill in the face FACE from frame-independent face data DATA.
957;; DATA should be the non-frame-specific ("global") face vector 989;; DATA should be the non-frame-specific ("global") face vector
958;; for the face. FACE should be a face name or face object. 990;; for the face. FACE should be a face name or face object.