comparison lisp/faces.el @ 213:78f53ef88e17 r20-4b5

Import from CVS: tag r20-4b5
author cvs
date Mon, 13 Aug 2007 10:06:47 +0200
parents 41ff10fd062f
children d44af0c54775
comparison
equal deleted inserted replaced
212:d8688acf4c5b 213:78f53ef88e17
960 (set-face-highlight-p face t locale 'tty))) 960 (set-face-highlight-p face t locale 'tty)))
961 (lambda () 961 (lambda ()
962 ;; handle X specific entries 962 ;; handle X specific entries
963 (cond ((featurep 'x) 963 (cond ((featurep 'x)
964 (frob-face-property face 'font 'x-make-font-bold locale)) 964 (frob-face-property face 'font 'x-make-font-bold locale))
965 ((featurep 'w32) 965 ((featurep 'mswindows)
966 (frob-face-property face 'font 'w32-make-font-bold locale)) 966 (frob-face-property face 'font 'mswindows-make-font-bold locale))
967 )) 967 ))
968 '(([default] . [bold]) 968 '(([default] . [bold])
969 ([bold] . t) 969 ([bold] . t)
970 ([italic] . [bold-italic]) 970 ([italic] . [bold-italic])
971 ([bold-italic] . t)))) 971 ([bold-italic] . t))))
985 (set-face-underline-p face t locale 'tty))) 985 (set-face-underline-p face t locale 'tty)))
986 (lambda () 986 (lambda ()
987 ;; handle X specific entries 987 ;; handle X specific entries
988 (cond ((featurep 'x) 988 (cond ((featurep 'x)
989 (frob-face-property face 'font 'x-make-font-italic locale)) 989 (frob-face-property face 'font 'x-make-font-italic locale))
990 ((featurep 'w32) 990 ((featurep 'mswindows)
991 (frob-face-property face 'font 'w32-make-font-italic locale)) 991 (frob-face-property face 'font 'mswindows-make-font-italic locale))
992 )) 992 ))
993 '(([default] . [italic]) 993 '(([default] . [italic])
994 ([bold] . [bold-italic]) 994 ([bold] . [bold-italic])
995 ([italic] . t) 995 ([italic] . t)
996 ([bold-italic] . t)))) 996 ([bold-italic] . t))))
1011 (set-face-underline-p face t locale 'tty))) 1011 (set-face-underline-p face t locale 'tty)))
1012 (lambda () 1012 (lambda ()
1013 ;; handle X specific entries 1013 ;; handle X specific entries
1014 (cond ((featurep 'x) 1014 (cond ((featurep 'x)
1015 (frob-face-property face 'font 'x-make-font-bold-italic locale)) 1015 (frob-face-property face 'font 'x-make-font-bold-italic locale))
1016 ((featurep 'w32) 1016 ((featurep 'mswindows)
1017 (frob-face-property face 'font 'w32-make-font-bold-italic locale)) 1017 (frob-face-property face 'font 'mswindows-make-font-bold-italic locale))
1018 )) 1018 ))
1019 '(([default] . [italic]) 1019 '(([default] . [italic])
1020 ([bold] . [bold-italic]) 1020 ([bold] . [bold-italic])
1021 ([italic] . [bold-italic]) 1021 ([italic] . [bold-italic])
1022 ([bold-italic] . t)))) 1022 ([bold-italic] . t))))
1036 (set-face-highlight-p face nil locale 'tty))) 1036 (set-face-highlight-p face nil locale 'tty)))
1037 (lambda () 1037 (lambda ()
1038 ;; handle X specific entries 1038 ;; handle X specific entries
1039 (cond ((featurep 'x) 1039 (cond ((featurep 'x)
1040 (frob-face-property face 'font 'x-make-font-unbold locale)) 1040 (frob-face-property face 'font 'x-make-font-unbold locale))
1041 ((featurep 'w32) 1041 ((featurep 'mswindows)
1042 (frob-face-property face 'font 'w32-make-font-unbold locale)) 1042 (frob-face-property face 'font 'mswindows-make-font-unbold locale))
1043 )) 1043 ))
1044 '(([default] . t) 1044 '(([default] . t)
1045 ([bold] . [default]) 1045 ([bold] . [default])
1046 ([italic] . t) 1046 ([italic] . t)
1047 ([bold-italic] . [italic])))) 1047 ([bold-italic] . [italic]))))
1061 (set-face-underline-p face nil locale 'tty))) 1061 (set-face-underline-p face nil locale 'tty)))
1062 (lambda () 1062 (lambda ()
1063 ;; handle X specific entries 1063 ;; handle X specific entries
1064 (cond ((featurep 'x) 1064 (cond ((featurep 'x)
1065 (frob-face-property face 'font 'x-make-font-unitalic locale)) 1065 (frob-face-property face 'font 'x-make-font-unitalic locale))
1066 ((featurep 'w32) 1066 ((featurep 'mswindows)
1067 (frob-face-property face 'font 'w32-make-font-unitalic locale)) 1067 (frob-face-property face 'font 'mswindows-make-font-unitalic locale))
1068 )) 1068 ))
1069 '(([default] . t) 1069 '(([default] . t)
1070 ([bold] . t) 1070 ([bold] . t)
1071 ([italic] . [default]) 1071 ([italic] . [default])
1072 ([bold-italic] . [bold])))) 1072 ([bold-italic] . [bold]))))
1082 because they don't make sense in this context." 1082 because they don't make sense in this context."
1083 (interactive (list (read-face-name "Shrink which face: "))) 1083 (interactive (list (read-face-name "Shrink which face: ")))
1084 ;; handle X specific entries 1084 ;; handle X specific entries
1085 (cond ((featurep 'x) 1085 (cond ((featurep 'x)
1086 (frob-face-property face 'font 'x-find-smaller-font locale)) 1086 (frob-face-property face 'font 'x-find-smaller-font locale))
1087 ((featurep 'w32) 1087 ((featurep 'mswindows)
1088 (frob-face-property face 'font 'w32-find-smaller-font locale)))) 1088 (frob-face-property face 'font 'mswindows-find-smaller-font locale))))
1089 1089
1090 (defun make-face-larger (face &optional locale) 1090 (defun make-face-larger (face &optional locale)
1091 "Make the font of the given face be larger, if possible. 1091 "Make the font of the given face be larger, if possible.
1092 See `make-face-smaller' for the semantics of the LOCALE argument." 1092 See `make-face-smaller' for the semantics of the LOCALE argument."
1093 (interactive (list (read-face-name "Enlarge which face: "))) 1093 (interactive (list (read-face-name "Enlarge which face: ")))
1094 ;; handle X specific entries 1094 ;; handle X specific entries
1095 (cond ((featurep 'x) 1095 (cond ((featurep 'x)
1096 (frob-face-property face 'font 'x-find-larger-font locale)) 1096 (frob-face-property face 'font 'x-find-larger-font locale))
1097 ((featurep 'w32) 1097 ((featurep 'mswindows)
1098 (frob-face-property face 'font 'w32-find-larger-font locale)))) 1098 (frob-face-property face 'font 'mswindows-find-larger-font locale))))
1099 1099
1100 (defun invert-face (face &optional locale) 1100 (defun invert-face (face &optional locale)
1101 "Swap the foreground and background colors of the face." 1101 "Swap the foreground and background colors of the face."
1102 (interactive (list (read-face-name "Invert face: "))) 1102 (interactive (list (read-face-name "Invert face: ")))
1103 (if (valid-specifier-domain-p locale) 1103 (if (valid-specifier-domain-p locale)
1344 (loop for face in (face-list) do 1344 (loop for face in (face-list) do
1345 (init-face-from-resources face device)) 1345 (init-face-from-resources face device))
1346 ;; Then do any device-specific initialization. 1346 ;; Then do any device-specific initialization.
1347 (cond ((eq 'x (device-type device)) 1347 (cond ((eq 'x (device-type device))
1348 (x-init-device-faces device)) 1348 (x-init-device-faces device))
1349 ((eq 'w32 (device-type device)) 1349 ((eq 'mswindows (device-type device))
1350 (w32-init-device-faces device)) 1350 (mswindows-init-device-faces device))
1351 ;; Nothing to do for TTYs? 1351 ;; Nothing to do for TTYs?
1352 ) 1352 )
1353 (init-other-random-faces device))) 1353 (init-other-random-faces device)))
1354 1354
1355 (defun init-frame-faces (frame) 1355 (defun init-frame-faces (frame)
1358 (loop for face in (face-list) do 1358 (loop for face in (face-list) do
1359 (init-face-from-resources face frame)) 1359 (init-face-from-resources face frame))
1360 ;; Then do any frame-specific initialization. 1360 ;; Then do any frame-specific initialization.
1361 (cond ((eq 'x (frame-type frame)) 1361 (cond ((eq 'x (frame-type frame))
1362 (x-init-frame-faces frame)) 1362 (x-init-frame-faces frame))
1363 ((eq 'w32 (frame-type frame)) 1363 ((eq 'mswindows (frame-type frame))
1364 (w32-init-frame-faces frame)) 1364 (mswindows-init-frame-faces frame))
1365 ;; Is there anything which should be done for TTY's? 1365 ;; Is there anything which should be done for TTY's?
1366 ))) 1366 )))
1367 1367
1368 ;; #### This is somewhat X-specific, and is called when the first 1368 ;; #### This is somewhat X-specific, and is called when the first
1369 ;; X device is created (even if there were TTY devices created 1369 ;; X device is created (even if there were TTY devices created
1548 ;; not already specified. 1548 ;; not already specified.
1549 (unless (or (face-differs-from-default-p 'list-mode-item-selected device) 1549 (unless (or (face-differs-from-default-p 'list-mode-item-selected device)
1550 (face-background 'list-mode-item-selected 'global)) 1550 (face-background 'list-mode-item-selected 'global))
1551 (set-face-background 'list-mode-item-selected "gray68" 'global 'color) 1551 (set-face-background 'list-mode-item-selected "gray68" 'global 'color)
1552 (set-face-background 'list-mode-item-selected "gray68" 'global 'grayscale) 1552 (set-face-background 'list-mode-item-selected "gray68" 'global 'grayscale)
1553 (if (featurep 'x) 1553 (unless (face-foreground 'list-mode-item-selected 'global)
1554 (unless (face-foreground 'list-mode-item-selected 'global) 1554 (set-face-background 'list-mode-item-selected
1555 (set-face-background 'list-mode-item-selected 1555 [default foreground] 'global '(mono x))
1556 [default foreground] 'global '(mono x)) 1556 (set-face-foreground 'list-mode-item-selected
1557 (set-face-foreground 'list-mode-item-selected 1557 [default background] 'global '(mono x))))
1558 [default background] 'global '(mono x)))))
1559 1558
1560 ;; if the list-mode-item-selected face isn't distinguished on this device, 1559 ;; if the list-mode-item-selected face isn't distinguished on this device,
1561 ;; at least try inverting it. 1560 ;; at least try inverting it.
1562 (unless (face-differs-from-default-p 'list-mode-item-selected device) 1561 (unless (face-differs-from-default-p 'list-mode-item-selected device)
1563 (invert-face 'list-mode-item-selected device)) 1562 (invert-face 'list-mode-item-selected device))
1612 This is an Emacs compatibility function; consider using 1611 This is an Emacs compatibility function; consider using
1613 set-face-background-pixmap instead. 1612 set-face-background-pixmap instead.
1614 1613
1615 PIXMAP should be a string, the name of a file of pixmap data. 1614 PIXMAP should be a string, the name of a file of pixmap data.
1616 The directories listed in the `x-bitmap-file-path' variable are searched. 1615 The directories listed in the `x-bitmap-file-path' variable are searched.
1617 Any kind of image file for which XEmacs has builtin support can be used.
1618 1616
1619 Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT 1617 Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT
1620 DATA) where WIDTH and HEIGHT are the size in pixels, and DATA is 1618 DATA) where WIDTH and HEIGHT are the size in pixels, and DATA is
1621 a string, containing the raw bits of the bitmap. XBM data is 1619 a string, containing the raw bits of the bitmap. XBM data is
1622 expected in this case, other types of image data will not work. 1620 expected in this case, other types of image data will not work.
1623 1621
1624 If the optional FRAME argument is provided, change only 1622 If the optional FRAME argument is provided, change only
1625 in that frame; otherwise change each frame." 1623 in that frame; otherwise change each frame."
1626 (while (not (find-face face)) 1624 (while (not (find-face face))
1627 (setq face (signal 'wrong-type-argument (list 'facep face)))) 1625 (setq face (signal 'wrong-type-argument (list 'facep face))))
1626 (locate-file pixmap x-bitmap-file-path ".xbm:" 4)
1628 (while (cond ((stringp pixmap) 1627 (while (cond ((stringp pixmap)
1629 (unless (file-readable-p pixmap) 1628 (unless (file-readable-p pixmap)
1630 (setq pixmap `[xbm :file ,pixmap])) 1629 (setq pixmap `[xbm :file ,pixmap]))
1631 nil) 1630 nil)
1632 ((and (consp pixmap) (= (length pixmap) 3)) 1631 ((and (consp pixmap) (= (length pixmap) 3))