1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-22 22:11:45 -07:00

(frame-update-face-colors): New function.

This commit is contained in:
Richard M. Stallman 1994-12-20 20:42:57 +00:00
parent 1787c22a78
commit f16c38ae77

View file

@ -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.