diff options
| author | Richard M. Stallman | 1997-05-25 21:52:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-25 21:52:33 +0000 |
| commit | 55893d25c012ec0ee3d0a953775b4653401c80a8 (patch) | |
| tree | f1f896602c9d0d09f4867670c8f557f975c0b6b9 | |
| parent | 5c431d149559ffd4359b935497e307b24e79df6f (diff) | |
| download | emacs-55893d25c012ec0ee3d0a953775b4653401c80a8.tar.gz emacs-55893d25c012ec0ee3d0a953775b4653401c80a8.zip | |
Unconditionally create the standard faces at load time.
Move face setup here from cus-start.el, and add attribute info.
| -rw-r--r-- | lisp/faces.el | 69 |
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." | |||
| 1110 | (princ doc) | 1110 | (princ doc) |
| 1111 | (princ "not documented as a face."))))) | 1111 | (princ "not documented as a face."))))) |
| 1112 | 1112 | ||
| 1113 | ;;; Make the standard faces. | ||
| 1114 | ;;; The C code knows the default and modeline faces as faces 0 and 1, | ||
| 1115 | ;;; so they must be the first two faces made. | ||
| 1116 | (defun face-initialize () | ||
| 1117 | (make-face 'default) | ||
| 1118 | (make-face 'modeline) | ||
| 1119 | (make-face 'highlight) | ||
| 1120 | |||
| 1121 | ;; These aren't really special in any way, but they're nice to have around. | ||
| 1122 | |||
| 1123 | (make-face 'bold) | ||
| 1124 | (make-face 'italic) | ||
| 1125 | (make-face 'bold-italic) | ||
| 1126 | (make-face 'region) | ||
| 1127 | (make-face 'secondary-selection) | ||
| 1128 | (make-face 'underline) | ||
| 1129 | |||
| 1130 | ;; We no longer set up any face attributes here. | ||
| 1131 | ;; They are specified in cus-start.el. | ||
| 1132 | |||
| 1133 | (setq region-face (face-id 'region))) | ||
| 1134 | |||
| 1135 | ;;; Setting a face based on a SPEC. | 1113 | ;;; Setting a face based on a SPEC. |
| 1136 | 1114 | ||
| 1137 | (defun face-spec-set (face spec &optional frame) | 1115 | (defun face-spec-set (face spec &optional frame) |
| @@ -1479,9 +1457,50 @@ examine the brightness for you." | |||
| 1479 | (funcall function face (car colors) frame))))) | 1457 | (funcall function face (car colors) frame))))) |
| 1480 | (setq colors (cdr colors))))))) | 1458 | (setq colors (cdr colors))))))) |
| 1481 | 1459 | ||
| 1482 | ;; If we are already using x-window frames, initialize faces for them. | 1460 | ;;; Make the standard faces. |
| 1483 | (if (memq (framep (selected-frame)) '(x w32)) | 1461 | ;;; The C code knows the default and modeline faces as faces 0 and 1, |
| 1484 | (face-initialize)) | 1462 | ;;; so they must be the first two faces made. |
| 1463 | (make-face 'default) | ||
| 1464 | (make-face 'modeline) | ||
| 1465 | (make-face 'highlight) | ||
| 1466 | |||
| 1467 | ;; These aren't really special in any way, but they're nice to have around. | ||
| 1468 | |||
| 1469 | (make-face 'bold) | ||
| 1470 | (make-face 'italic) | ||
| 1471 | (make-face 'bold-italic) | ||
| 1472 | (make-face 'region) | ||
| 1473 | (make-face 'secondary-selection) | ||
| 1474 | (make-face 'underline) | ||
| 1475 | |||
| 1476 | (setq region-face (face-id 'region)) | ||
| 1477 | |||
| 1478 | ;; Specify how these faces look, and their documentation. | ||
| 1479 | (let ((all '((bold "Use bold font." ((t (:bold t)))) | ||
| 1480 | (bold-italic "Use bold italic font." ((t (:bold t :italic t)))) | ||
| 1481 | (italic "Use italic font." ((t (:italic t)))) | ||
| 1482 | (underline "Underline text." ((t (:underline t)))) | ||
| 1483 | (default "Used for text not covered by other faces." ((t nil))) | ||
| 1484 | (highlight "Highlight text in some way." | ||
| 1485 | ((((class color)) (:background "darkseagreen2")) | ||
| 1486 | (t (:inverse-video t)))) | ||
| 1487 | (modeline "Used for displaying the modeline." | ||
| 1488 | ((t (:inverse-video t)))) | ||
| 1489 | (region "Used for displaying the region." | ||
| 1490 | ((t (:background "gray")))) | ||
| 1491 | (secondary-selection | ||
| 1492 | "Used for displaying the secondary selection." | ||
| 1493 | ((((class color)) (:background "paleturquoise")) | ||
| 1494 | (t (:inverse-video t)))))) | ||
| 1495 | entry symbol doc spec) | ||
| 1496 | (while all | ||
| 1497 | (setq entry (car all) | ||
| 1498 | all (cdr all) | ||
| 1499 | symbol (nth 0 entry) | ||
| 1500 | doc (nth 1 entry) | ||
| 1501 | spec (nth 2 entry)) | ||
| 1502 | (put symbol 'face-documentation doc) | ||
| 1503 | (put symbol 'face-defface-spec spec))) | ||
| 1485 | 1504 | ||
| 1486 | (provide 'faces) | 1505 | (provide 'faces) |
| 1487 | 1506 | ||