aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorDan Nicolaescu2005-11-05 07:29:45 +0000
committerDan Nicolaescu2005-11-05 07:29:45 +0000
commitd60b49ac4e4ef6cbb9752b21284407f352d2bd9e (patch)
tree66a3d8e66bae82ef8bd14f13b2d7c861b825a5eb /lisp/startup.el
parent6b19bd8250c2975fbf95c90950a1003defb39e55 (diff)
downloademacs-d60b49ac4e4ef6cbb9752b21284407f352d2bd9e.tar.gz
emacs-d60b49ac4e4ef6cbb9752b21284407f352d2bd9e.zip
* font-lock.el: Don't deal with font-lock-face-attributes here,
move the code ... * startup.el (command-line): ... here. Use face-spec-set instead of custom-declare-face. * faces.el (face-spec-set): Reset the face if spec is not nil.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el32
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 5e135433a26..8dae9103f01 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -958,6 +958,38 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
958 (or mail-host-address 958 (or mail-host-address
959 (system-name))))) 959 (system-name)))))
960 960
961 ;; Originally face attributes were specified via
962 ;; `font-lock-face-attributes'. Users then changed the default
963 ;; face attributes by setting that variable. However, we try and
964 ;; be back-compatible and respect its value if set except for
965 ;; faces where M-x customize has been used to save changes for the
966 ;; face.
967 (when (boundp 'font-lock-face-attributes)
968 (let ((face-attributes font-lock-face-attributes))
969 (while face-attributes
970 (let* ((face-attribute (pop face-attributes))
971 (face (car face-attribute)))
972 ;; Rustle up a `defface' SPEC from a
973 ;; `font-lock-face-attributes' entry.
974 (unless (get face 'saved-face)
975 (let ((foreground (nth 1 face-attribute))
976 (background (nth 2 face-attribute))
977 (bold-p (nth 3 face-attribute))
978 (italic-p (nth 4 face-attribute))
979 (underline-p (nth 5 face-attribute))
980 face-spec)
981 (when foreground
982 (setq face-spec (cons ':foreground (cons foreground face-spec))))
983 (when background
984 (setq face-spec (cons ':background (cons background face-spec))))
985 (when bold-p
986 (setq face-spec (append '(:weight bold) face-spec)))
987 (when italic-p
988 (setq face-spec (append '(:slant italic) face-spec)))
989 (when underline-p
990 (setq face-spec (append '(:underline t) face-spec)))
991 (face-spec-set face (list (list t face-spec)) nil)))))))
992
961 ;; If parameter have been changed in the init file which influence 993 ;; If parameter have been changed in the init file which influence
962 ;; face realization, clear the face cache so that new faces will 994 ;; face realization, clear the face cache so that new faces will
963 ;; be realized. 995 ;; be realized.