summaryrefslogtreecommitdiff
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-05-25 21:52:33 +0000
committerRichard M. Stallman <rms@gnu.org>1997-05-25 21:52:33 +0000
commit093377046a68223c5ea06376931aca315e4321f9 (patch)
tree2d493ceaf9c2b6499154efe75ec32b3189a6196f /lisp/faces.el
parent0ddee97d677d3ef2b6085b5d68b9f5ff029ad5e3 (diff)
downloademacs-093377046a68223c5ea06376931aca315e4321f9.tar.gz
Unconditionally create the standard faces at load time.
Move face setup here from cus-start.el, and add attribute info.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el69
1 files changed, 44 insertions, 25 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index d8e12bafad7..060a78cf9d3 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1110,28 +1110,6 @@ selected frame."
(princ doc)
(princ "not documented as a face.")))))
-;;; Make the standard faces.
-;;; The C code knows the default and modeline faces as faces 0 and 1,
-;;; so they must be the first two faces made.
-(defun face-initialize ()
- (make-face 'default)
- (make-face 'modeline)
- (make-face 'highlight)
-
- ;; These aren't really special in any way, but they're nice to have around.
-
- (make-face 'bold)
- (make-face 'italic)
- (make-face 'bold-italic)
- (make-face 'region)
- (make-face 'secondary-selection)
- (make-face 'underline)
-
- ;; We no longer set up any face attributes here.
- ;; They are specified in cus-start.el.
-
- (setq region-face (face-id 'region)))
-
;;; Setting a face based on a SPEC.
(defun face-spec-set (face spec &optional frame)
@@ -1479,9 +1457,50 @@ examine the brightness for you."
(funcall function face (car colors) frame)))))
(setq colors (cdr colors)))))))
-;; If we are already using x-window frames, initialize faces for them.
-(if (memq (framep (selected-frame)) '(x w32))
- (face-initialize))
+;;; Make the standard faces.
+;;; The C code knows the default and modeline faces as faces 0 and 1,
+;;; so they must be the first two faces made.
+(make-face 'default)
+(make-face 'modeline)
+(make-face 'highlight)
+
+;; These aren't really special in any way, but they're nice to have around.
+
+(make-face 'bold)
+(make-face 'italic)
+(make-face 'bold-italic)
+(make-face 'region)
+(make-face 'secondary-selection)
+(make-face 'underline)
+
+(setq region-face (face-id 'region))
+
+;; Specify how these faces look, and their documentation.
+(let ((all '((bold "Use bold font." ((t (:bold t))))
+ (bold-italic "Use bold italic font." ((t (:bold t :italic t))))
+ (italic "Use italic font." ((t (:italic t))))
+ (underline "Underline text." ((t (:underline t))))
+ (default "Used for text not covered by other faces." ((t nil)))
+ (highlight "Highlight text in some way."
+ ((((class color)) (:background "darkseagreen2"))
+ (t (:inverse-video t))))
+ (modeline "Used for displaying the modeline."
+ ((t (:inverse-video t))))
+ (region "Used for displaying the region."
+ ((t (:background "gray"))))
+ (secondary-selection
+ "Used for displaying the secondary selection."
+ ((((class color)) (:background "paleturquoise"))
+ (t (:inverse-video t))))))
+ entry symbol doc spec)
+ (while all
+ (setq entry (car all)
+ all (cdr all)
+ symbol (nth 0 entry)
+ doc (nth 1 entry)
+ spec (nth 2 entry))
+ (put symbol 'face-documentation doc)
+ (put symbol 'face-defface-spec spec)))
(provide 'faces)