Mercurial > emacs
comparison lisp/faces.el @ 2715:9caee9338229
* faces.el: Call internal-set-face-1, not internat-set-face-1.
* faces.el: Don't set frame-creation-function here; x-win.el is
the appropriate place to set it.
* faces.el: Only apply x-initialize-frame-faces to X frames; pass
over terminal frames.
* faces.el: Provide 'faces.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sun, 09 May 1993 23:48:41 +0000 |
parents | bfe999b19082 |
children | f4fc0c4c76f9 |
comparison
equal
deleted
inserted
replaced
2714:bfe999b19082 | 2715:9caee9338229 |
---|---|
100 If the optional argument FRAME is given, report on face FACE in that frame. | 100 If the optional argument FRAME is given, report on face FACE in that frame. |
101 Otherwise report on the defaults for face FACE (for new frames)." | 101 Otherwise report on the defaults for face FACE (for new frames)." |
102 (aref (internal-get-face face frame) 7)) | 102 (aref (internal-get-face face frame) 7)) |
103 | 103 |
104 | 104 |
105 (defun internat-set-face-1 (face name value index frame) | 105 (defun internal-set-face-1 (face name value index frame) |
106 (let ((inhibit-quit t)) | 106 (let ((inhibit-quit t)) |
107 (if (null frame) | 107 (if (null frame) |
108 (let ((frames (frame-list))) | 108 (let ((frames (frame-list))) |
109 (while frames | 109 (while frames |
110 (internat-set-face-1 (face-name face) name value index (car frames)) | 110 (internal-set-face-1 (face-name face) name value index (car frames)) |
111 (setq frames (cdr frames))) | 111 (setq frames (cdr frames))) |
112 (aset (internal-get-face (if (symbolp face) face (face-name face)) t) | 112 (aset (internal-get-face (if (symbolp face) face (face-name face)) t) |
113 index value) | 113 index value) |
114 value) | 114 value) |
115 (or (eq frame t) | 115 (or (eq frame t) |
144 (defsubst set-face-font (face font &optional frame) | 144 (defsubst set-face-font (face font &optional frame) |
145 "Change the font of face FACE to FONT (a string). | 145 "Change the font of face FACE to FONT (a string). |
146 If the optional FRAME argument is provided, change only | 146 If the optional FRAME argument is provided, change only |
147 in that frame; otherwise change each frame." | 147 in that frame; otherwise change each frame." |
148 (interactive (internal-face-interactive "font")) | 148 (interactive (internal-face-interactive "font")) |
149 (internat-set-face-1 face 'font font 3 frame)) | 149 (internal-set-face-1 face 'font font 3 frame)) |
150 | 150 |
151 (defsubst set-face-foreground (face color &optional frame) | 151 (defsubst set-face-foreground (face color &optional frame) |
152 "Change the foreground color of face FACE to COLOR (a string). | 152 "Change the foreground color of face FACE to COLOR (a string). |
153 If the optional FRAME argument is provided, change only | 153 If the optional FRAME argument is provided, change only |
154 in that frame; otherwise change each frame." | 154 in that frame; otherwise change each frame." |
155 (interactive (internal-face-interactive "foreground")) | 155 (interactive (internal-face-interactive "foreground")) |
156 (internat-set-face-1 face 'foreground color 4 frame)) | 156 (internal-set-face-1 face 'foreground color 4 frame)) |
157 | 157 |
158 (defsubst set-face-background (face color &optional frame) | 158 (defsubst set-face-background (face color &optional frame) |
159 "Change the background color of face FACE to COLOR (a string). | 159 "Change the background color of face FACE to COLOR (a string). |
160 If the optional FRAME argument is provided, change only | 160 If the optional FRAME argument is provided, change only |
161 in that frame; otherwise change each frame." | 161 in that frame; otherwise change each frame." |
162 (interactive (internal-face-interactive "background")) | 162 (interactive (internal-face-interactive "background")) |
163 (internat-set-face-1 face 'background color 5 frame)) | 163 (internal-set-face-1 face 'background color 5 frame)) |
164 | 164 |
165 (defsubst set-face-background-pixmap (face name &optional frame) | 165 (defsubst set-face-background-pixmap (face name &optional frame) |
166 "Change the background pixmap of face FACE to PIXMAP. | 166 "Change the background pixmap of face FACE to PIXMAP. |
167 PIXMAP should be a string, the name of a file of pixmap data. | 167 PIXMAP should be a string, the name of a file of pixmap data. |
168 The directories listed in the `x-bitmap-file-path' variable are searched. | 168 The directories listed in the `x-bitmap-file-path' variable are searched. |
172 and DATA is a string, containing the raw bits of the bitmap. | 172 and DATA is a string, containing the raw bits of the bitmap. |
173 | 173 |
174 If the optional FRAME argument is provided, change only | 174 If the optional FRAME argument is provided, change only |
175 in that frame; otherwise change each frame." | 175 in that frame; otherwise change each frame." |
176 (interactive (internal-face-interactive "background-pixmap")) | 176 (interactive (internal-face-interactive "background-pixmap")) |
177 (internat-set-face-1 face 'background-pixmap name 6 frame)) | 177 (internal-set-face-1 face 'background-pixmap name 6 frame)) |
178 | 178 |
179 (defsubst set-face-underline-p (face underline-p &optional frame) | 179 (defsubst set-face-underline-p (face underline-p &optional frame) |
180 "Specify whether face FACE is underlined. (Yes if UNDERLINE-P is non-nil.) | 180 "Specify whether face FACE is underlined. (Yes if UNDERLINE-P is non-nil.) |
181 If the optional FRAME argument is provided, change only | 181 If the optional FRAME argument is provided, change only |
182 in that frame; otherwise change each frame." | 182 in that frame; otherwise change each frame." |
183 (interactive (internal-face-interactive "underline-p" "underlined")) | 183 (interactive (internal-face-interactive "underline-p" "underlined")) |
184 (internat-set-face-1 face 'underline underline-p 7 frame)) | 184 (internal-set-face-1 face 'underline underline-p 7 frame)) |
185 | 185 |
186 | 186 |
187 (defun make-face (name) | 187 (defun make-face (name) |
188 "Define a new FACE on all frames. | 188 "Define a new FACE on all frames. |
189 You can modify the font, color, etc of this face with the set-face- functions. | 189 You can modify the font, color, etc of this face with the set-face- functions. |
728 ;;; (if (and (not (face-foreground modeline frame)) | 728 ;;; (if (and (not (face-foreground modeline frame)) |
729 ;;; (face-foreground default frame)) | 729 ;;; (face-foreground default frame)) |
730 ;;; (set-face-foreground modeline (face-foreground default frame) frame)) | 730 ;;; (set-face-foreground modeline (face-foreground default frame) frame)) |
731 frame)) | 731 frame)) |
732 | 732 |
733 (setq frame-creation-function 'x-create-frame-with-faces) | |
734 | |
735 ;; Set up the faces of all existing frames. | 733 ;; Set up the faces of all existing frames. |
736 (let ((frames (frame-list))) | 734 (let ((frames (frame-list))) |
737 (while frames | 735 (while frames |
738 (x-initialize-frame-faces (car frames)) | 736 (if (eq (framep (car frames)) 'x) |
737 (x-initialize-frame-faces (car frames))) | |
739 (setq frames (cdr frames)))) | 738 (setq frames (cdr frames)))) |
740 | 739 |
740 (provide 'faces) | |
741 | |
741 ;;; faces.el ends here | 742 ;;; faces.el ends here |