comparison lisp/faces.el @ 263:727739f917cb r20-5b30

Import from CVS: tag r20-5b30
author cvs
date Mon, 13 Aug 2007 10:24:41 +0200
parents 0e522484dd2a
children 8efd647ea9ca
comparison
equal deleted inserted replaced
262:9d8607af9e13 263:727739f917cb
964 ;; handle TTY specific entries 964 ;; handle TTY specific entries
965 (when (featurep 'tty) 965 (when (featurep 'tty)
966 (set-face-highlight-p face t locale 'tty))) 966 (set-face-highlight-p face t locale 'tty)))
967 (lambda () 967 (lambda ()
968 ;; handle X specific entries 968 ;; handle X specific entries
969 (cond ((featurep 'x) 969 (when (featurep 'x)
970 (frob-face-property face 'font 'x-make-font-bold locale)) 970 (frob-face-property face 'font 'x-make-font-bold locale))
971 ((featurep 'mswindows) 971 (when (featurep 'mswindows)
972 (frob-face-property face 'font 'mswindows-make-font-bold locale)) 972 (frob-face-property face 'font 'mswindows-make-font-bold locale))
973 )) 973 )
974 '(([default] . [bold]) 974 '(([default] . [bold])
975 ([bold] . t) 975 ([bold] . t)
976 ([italic] . [bold-italic]) 976 ([italic] . [bold-italic])
977 ([bold-italic] . t)))) 977 ([bold-italic] . t))))
978 978
989 ;; handle TTY specific entries 989 ;; handle TTY specific entries
990 (when (featurep 'tty) 990 (when (featurep 'tty)
991 (set-face-underline-p face t locale 'tty))) 991 (set-face-underline-p face t locale 'tty)))
992 (lambda () 992 (lambda ()
993 ;; handle X specific entries 993 ;; handle X specific entries
994 (cond ((featurep 'x) 994 (when (featurep 'x)
995 (frob-face-property face 'font 'x-make-font-italic locale)) 995 (frob-face-property face 'font 'x-make-font-italic locale))
996 ((featurep 'mswindows) 996 (when (featurep 'mswindows)
997 (frob-face-property face 'font 'mswindows-make-font-italic locale)) 997 (frob-face-property face 'font 'mswindows-make-font-italic locale))
998 )) 998 )
999 '(([default] . [italic]) 999 '(([default] . [italic])
1000 ([bold] . [bold-italic]) 1000 ([bold] . [bold-italic])
1001 ([italic] . t) 1001 ([italic] . t)
1002 ([bold-italic] . t)))) 1002 ([bold-italic] . t))))
1003 1003
1015 (when (featurep 'tty) 1015 (when (featurep 'tty)
1016 (set-face-highlight-p face t locale 'tty) 1016 (set-face-highlight-p face t locale 'tty)
1017 (set-face-underline-p face t locale 'tty))) 1017 (set-face-underline-p face t locale 'tty)))
1018 (lambda () 1018 (lambda ()
1019 ;; handle X specific entries 1019 ;; handle X specific entries
1020 (cond ((featurep 'x) 1020 (when (featurep 'x)
1021 (frob-face-property face 'font 'x-make-font-bold-italic locale)) 1021 (frob-face-property face 'font 'x-make-font-bold-italic locale))
1022 ((featurep 'mswindows) 1022 (when (featurep 'mswindows)
1023 (frob-face-property face 'font 'mswindows-make-font-bold-italic locale)) 1023 (frob-face-property face 'font 'mswindows-make-font-bold-italic locale))
1024 )) 1024 )
1025 '(([default] . [italic]) 1025 '(([default] . [italic])
1026 ([bold] . [bold-italic]) 1026 ([bold] . [bold-italic])
1027 ([italic] . [bold-italic]) 1027 ([italic] . [bold-italic])
1028 ([bold-italic] . t)))) 1028 ([bold-italic] . t))))
1029 1029
1040 ;; handle TTY specific entries 1040 ;; handle TTY specific entries
1041 (when (featurep 'tty) 1041 (when (featurep 'tty)
1042 (set-face-highlight-p face nil locale 'tty))) 1042 (set-face-highlight-p face nil locale 'tty)))
1043 (lambda () 1043 (lambda ()
1044 ;; handle X specific entries 1044 ;; handle X specific entries
1045 (cond ((featurep 'x) 1045 (when (featurep 'x)
1046 (frob-face-property face 'font 'x-make-font-unbold locale)) 1046 (frob-face-property face 'font 'x-make-font-unbold locale))
1047 ((featurep 'mswindows) 1047 (when (featurep 'mswindows)
1048 (frob-face-property face 'font 'mswindows-make-font-unbold locale)) 1048 (frob-face-property face 'font 'mswindows-make-font-unbold locale))
1049 )) 1049 )
1050 '(([default] . t) 1050 '(([default] . t)
1051 ([bold] . [default]) 1051 ([bold] . [default])
1052 ([italic] . t) 1052 ([italic] . t)
1053 ([bold-italic] . [italic])))) 1053 ([bold-italic] . [italic]))))
1054 1054
1065 ;; handle TTY specific entries 1065 ;; handle TTY specific entries
1066 (when (featurep 'tty) 1066 (when (featurep 'tty)
1067 (set-face-underline-p face nil locale 'tty))) 1067 (set-face-underline-p face nil locale 'tty)))
1068 (lambda () 1068 (lambda ()
1069 ;; handle X specific entries 1069 ;; handle X specific entries
1070 (cond ((featurep 'x) 1070 (when (featurep 'x)
1071 (frob-face-property face 'font 'x-make-font-unitalic locale)) 1071 (frob-face-property face 'font 'x-make-font-unitalic locale))
1072 ((featurep 'mswindows) 1072 (when (featurep 'mswindows)
1073 (frob-face-property face 'font 'mswindows-make-font-unitalic locale)) 1073 (frob-face-property face 'font 'mswindows-make-font-unitalic locale))
1074 )) 1074 )
1075 '(([default] . t) 1075 '(([default] . t)
1076 ([bold] . t) 1076 ([bold] . t)
1077 ([italic] . [default]) 1077 ([italic] . [default])
1078 ([bold-italic] . [bold])))) 1078 ([bold-italic] . [bold]))))
1079 1079
1086 LOCALE works as in `make-face-bold' et al., but the ``inheriting- 1086 LOCALE works as in `make-face-bold' et al., but the ``inheriting-
1087 from-the-bold-face'' operations described there are not done 1087 from-the-bold-face'' operations described there are not done
1088 because they don't make sense in this context." 1088 because they don't make sense in this context."
1089 (interactive (list (read-face-name "Shrink which face: "))) 1089 (interactive (list (read-face-name "Shrink which face: ")))
1090 ;; handle X specific entries 1090 ;; handle X specific entries
1091 (cond ((featurep 'x) 1091 (when (featurep 'x)
1092 (frob-face-property face 'font 'x-find-smaller-font locale)) 1092 (frob-face-property face 'font 'x-find-smaller-font locale))
1093 ((featurep 'mswindows) 1093 (when (featurep 'mswindows)
1094 (frob-face-property face 'font 'mswindows-find-smaller-font locale)))) 1094 (frob-face-property face 'font 'mswindows-find-smaller-font locale)))
1095 1095
1096 (defun make-face-larger (face &optional locale) 1096 (defun make-face-larger (face &optional locale)
1097 "Make the font of the given face be larger, if possible. 1097 "Make the font of the given face be larger, if possible.
1098 See `make-face-smaller' for the semantics of the LOCALE argument." 1098 See `make-face-smaller' for the semantics of the LOCALE argument."
1099 (interactive (list (read-face-name "Enlarge which face: "))) 1099 (interactive (list (read-face-name "Enlarge which face: ")))
1100 ;; handle X specific entries 1100 ;; handle X specific entries
1101 (cond ((featurep 'x) 1101 (when (featurep 'x)
1102 (frob-face-property face 'font 'x-find-larger-font locale)) 1102 (frob-face-property face 'font 'x-find-larger-font locale))
1103 ((featurep 'mswindows) 1103 (when (featurep 'mswindows)
1104 (frob-face-property face 'font 'mswindows-find-larger-font locale)))) 1104 (frob-face-property face 'font 'mswindows-find-larger-font locale)))
1105 1105
1106 (defun invert-face (face &optional locale) 1106 (defun invert-face (face &optional locale)
1107 "Swap the foreground and background colors of the face." 1107 "Swap the foreground and background colors of the face."
1108 (interactive (list (read-face-name "Invert face: "))) 1108 (interactive (list (read-face-name "Invert face: ")))
1109 (if (valid-specifier-domain-p locale) 1109 (if (valid-specifier-domain-p locale)
1382 (defun init-global-faces () 1382 (defun init-global-faces ()
1383 ;; Look for global face resources. 1383 ;; Look for global face resources.
1384 (loop for face in (face-list) do 1384 (loop for face in (face-list) do
1385 (init-face-from-resources face 'global)) 1385 (init-face-from-resources face 'global))
1386 ;; Further X frobbing. 1386 ;; Further X frobbing.
1387 (x-init-global-faces) 1387 (case window-system
1388 (x (x-init-global-faces))
1389 (mswindows (mswindows-init-global-faces)))
1388 ;; for bold and the like, make the global specification be bold etc. 1390 ;; for bold and the like, make the global specification be bold etc.
1389 ;; if the user didn't already specify a value. These will also be 1391 ;; if the user didn't already specify a value. These will also be
1390 ;; frobbed further in init-other-random-faces. 1392 ;; frobbed further in init-other-random-faces.
1391 (unless (face-font 'bold 'global) 1393 (unless (face-font 'bold 'global)
1392 (make-face-bold 'bold 'global)) 1394 (make-face-bold 'bold 'global))