comparison lisp/x-faces.el @ 4819:49480d838d32

Deactivate obsolete x-face initialization cod
author Didier Verna <didier@lrde.epita.fr>
date Sat, 09 Jan 2010 18:26:58 +0100
parents de99c4dbad18
children 0482cdb4e35d
comparison
equal deleted inserted replaced
4818:1360b0c147c1 4819:49480d838d32
908 ;;; x-init-global-faces is responsible for ensuring that the 908 ;;; x-init-global-faces is responsible for ensuring that the
909 ;;; default face has some reasonable fallbacks if nothing else is 909 ;;; default face has some reasonable fallbacks if nothing else is
910 ;;; specified. 910 ;;; specified.
911 ;;; 911 ;;;
912 (defun x-init-global-faces () 912 (defun x-init-global-faces ()
913 (or (face-foreground 'default 'global) 913 ;; #### NOTE: this code is probably an oldy: faces.c ensures that we have
914 (set-face-foreground 'default "black" 'global '(x default))) 914 ;; working fallback values so there is no need to initialize anything here.
915 (or (face-background 'default 'global) 915 ;; -- dvl
916 (set-face-background 'default "gray80" 'global '(x default)))) 916 ;; (or (face-foreground 'default 'global)
917 ;; (set-face-foreground 'default "black" 'global '(x default)))
918 ;; (or (face-background 'default 'global)
919 ;; (set-face-background 'default "gray80" 'global '(x default))
920 )
917 921
918 ;;; x-init-device-faces is responsible for initializing default 922 ;;; x-init-device-faces is responsible for initializing default
919 ;;; values for faces on a newly created device. 923 ;;; values for faces on a newly created device.
920 ;;; 924 ;;;
921 (defun x-init-device-faces (device) 925 (defun x-init-device-faces (device)
957 ;; err on the side of the English speaker in this case because they are 961 ;; err on the side of the English speaker in this case because they are
958 ;; much less likely to have encountered this problem, and are thus less 962 ;; much less likely to have encountered this problem, and are thus less
959 ;; likely to know what to do about it. ]] 963 ;; likely to know what to do about it. ]]
960 964
961 965
962 ;; 966 ;; #### NOTE: this code is probably an oldy as well (as per Ben's comment
963 ;; If the "default" face didn't have both colors specified, then pick 967 ;; above): faces.c ensures that we have working fallback values so there is
964 ;; some, taking into account whether one of the colors was specified. 968 ;; no need to initialize anything here. -- dvl
965 ;; 969
966 (let ((fg (face-foreground-instance 'default device)) 970 ;; (let ((fg (face-foreground-instance 'default device))
967 (bg (face-background-instance 'default device))) 971 ;; (bg (face-background-instance 'default device)))
968 (if (not (and fg bg)) 972 ;; (if (not (and fg bg))
969 (if (or (and fg (equalp (color-instance-name fg) "white")) 973 ;; (if (or (and fg (equalp (color-instance-name fg) "white"))
970 (and bg (equalp (color-instance-name bg) "black"))) 974 ;; (and bg (equalp (color-instance-name bg) "black")))
971 (progn 975 ;; (progn
972 (or fg (set-face-foreground 'default "white" device)) 976 ;; (or fg (set-face-foreground 'default "white" device))
973 (or bg (set-face-background 'default "black" device))) 977 ;; (or bg (set-face-background 'default "black" device)))
974 (or fg (set-face-foreground 'default "white" device)) 978 ;; (or fg (set-face-foreground 'default "white" device))
975 (or bg (set-face-background 'default "black" device))))) 979 ;; (or bg (set-face-background 'default "black" device)))))
976 980
977 ;; Don't look at reverseVideo now or initialize the modeline. This 981 ;; Don't look at reverseVideo now or initialize the modeline. This
978 ;; is done on a per-frame basis at the appropriate time. 982 ;; is done on a per-frame basis at the appropriate time.
979 983
980 ;; 984 ;;
981 ;; Now let's try to pick some reasonable defaults for a few other faces. 985 ;; Now let's try to pick some reasonable defaults for a few other faces.
1003 ;; If reverseVideo was specified, swap the foreground and background 1007 ;; If reverseVideo was specified, swap the foreground and background
1004 ;; of the default and modeline faces. 1008 ;; of the default and modeline faces.
1005 ;; 1009 ;;
1006 (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame 1010 (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame
1007 nil 'warn)) 1011 nil 'warn))
1008 ;; First make sure the modeline has fg and bg, inherited from the 1012 ;; #### NOTE: again, this is probably yet another oldy: faces.c
1009 ;; current default face - for the case where only one is specified, 1013 ;; ensures sane fallbacks for the modeline face. Besides, this face
1010 ;; so that invert-face doesn't do something weird. 1014 ;; does not inherit from the default face, but from the gui-element
1011 (or (face-foreground 'modeline frame) 1015 ;; one.-- dvl
1012 (set-face-foreground 'modeline 1016
1013 (face-foreground-instance 'default frame) 1017 ;; (or (face-foreground 'modeline frame)
1014 frame)) 1018 ;; (set-face-foreground 'modeline
1015 (or (face-background 'modeline frame) 1019 ;; (face-foreground-instance 'default frame)
1016 (set-face-background 'modeline 1020 ;; frame))
1017 (face-background-instance 'default frame) 1021 ;; (or (face-background 'modeline frame)
1018 frame)) 1022 ;; (set-face-background 'modeline
1023 ;; (face-background-instance 'default frame)
1024 ;; frame))
1025
1019 ;; Now invert both of them. If they end up looking the same, 1026 ;; Now invert both of them. If they end up looking the same,
1020 ;; make-frame-initial-faces will invert the modeline again later. 1027 ;; make-frame-initial-faces will invert the modeline again later.
1021 (invert-face 'default frame) 1028 (invert-face 'default frame)
1022 (invert-face 'modeline frame) 1029 (invert-face 'modeline frame)
1023 ))) 1030 )))