comparison lisp/custom/cus-face.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents d620409f5eb8
children 8d2a9b52c682 9f59509498e1
comparison
equal deleted inserted replaced
35:279432d5c479 36:c53a95d3c46d
2 ;; 2 ;;
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 ;; 4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Keywords: help, faces 6 ;; Keywords: help, faces
7 ;; Version: 1.64 7 ;; Version: 1.65
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10 ;;; Commentary: 10 ;;; Commentary:
11 ;; 11 ;;
12 ;; See `custom.el'. 12 ;; See `custom.el'.
109 (make-face-x-resource-internal face frame t)))) 109 (make-face-x-resource-internal face frame t))))
110 (t 110 (t
111 ;; Too hard to do right on XEmacs. 111 ;; Too hard to do right on XEmacs.
112 (defalias 'initialize-face-resources 'ignore))) 112 (defalias 'initialize-face-resources 'ignore)))
113 113
114 (if (string-match "XEmacs" emacs-version) 114 ;;(if (string-match "XEmacs" emacs-version)
115 ;; Xemacs. 115 ;; ;; Xemacs.
116 (defun custom-invert-face (face &optional frame) 116 ;; (defun custom-invert-face (face &optional frame)
117 "Swap the foreground and background colors of face FACE. 117 ;; "Swap the foreground and background colors of face FACE.
118 If the colors are not specified in the face, use the default colors." 118 ;;If the colors are not specified in the face, use the default colors."
119 (interactive (list (read-face-name "Reverse face: "))) 119 ;; (interactive (list (read-face-name "Reverse face: ")))
120 (let ((fg (color-name (face-foreground face frame) frame)) 120 ;; (let ((fg (color-name (face-foreground face frame) frame))
121 (bg (color-name (face-background face frame) frame))) 121 ;; (bg (color-name (face-background face frame) frame)))
122 (set-face-foreground face bg frame) 122 ;; (set-face-foreground face bg frame)
123 (set-face-background face fg frame))) 123 ;; (set-face-background face fg frame)))
124 ;; Emacs. 124 ;; ;; Emacs.
125 (defun custom-invert-face (face &optional frame) 125 ;; (defun custom-invert-face (face &optional frame)
126 "Swap the foreground and background colors of face FACE. 126 ;; "Swap the foreground and background colors of face FACE.
127 If the colors are not specified in the face, use the default colors." 127 ;;If the colors are not specified in the face, use the default colors."
128 (interactive (list (read-face-name "Reverse face: "))) 128 ;; (interactive (list (read-face-name "Reverse face: ")))
129 (let ((fg (or (face-foreground face frame) 129 ;; (let ((fg (or (face-foreground face frame)
130 (face-foreground 'default frame) 130 ;; (face-foreground 'default frame)
131 (frame-property (or frame (selected-frame)) 131 ;; (frame-property (or frame (selected-frame))
132 'foreground-color) 132 ;; 'foreground-color)
133 "black")) 133 ;; "black"))
134 (bg (or (face-background face frame) 134 ;; (bg (or (face-background face frame)
135 (face-background 'default frame) 135 ;; (face-background 'default frame)
136 (frame-property (or frame (selected-frame)) 136 ;; (frame-property (or frame (selected-frame))
137 'background-color) 137 ;; 'background-color)
138 "white"))) 138 ;; "white")))
139 (set-face-foreground face bg frame) 139 ;; (set-face-foreground face bg frame)
140 (set-face-background face fg frame)))) 140 ;; (set-face-background face fg frame))))
141 141
142 (defcustom custom-background-mode nil 142 (defcustom custom-background-mode nil
143 "The brightness of the background. 143 "The brightness of the background.
144 Set this to the symbol dark if your background color is dark, light if 144 Set this to the symbol dark if your background color is dark, light if
145 your background is light, or nil (default) if you want Emacs to 145 your background is light, or nil (default) if you want Emacs to
247 set-face-foreground) 247 set-face-foreground)
248 (:background (color :tag "Background" 248 (:background (color :tag "Background"
249 :value "white" 249 :value "white"
250 :help-echo "Set background color.") 250 :help-echo "Set background color.")
251 set-face-background) 251 set-face-background)
252 (:invert (const :format "Invert Face\n" 252 ;; (:invert (const :format "Invert Face\n"
253 :sibling-args (:help-echo "\ 253 ;; :sibling-args (:help-echo "
254 Reverse the foreground and background color. 254 ;;Reverse the foreground and background color.
255 If you haven't specified them for the face, the default colors will be used.") 255 ;;If you haven't specified them for the face, the default colors will be used.")
256 t) 256 ;; t)
257 (lambda (face value &optional frame) 257 ;; (lambda (face value &optional frame)
258 ;; We don't use VALUE. 258 ;; ;; We don't use VALUE.
259 (custom-invert-face face frame))) 259 ;; (custom-invert-face face frame)))
260 (:stipple (editable-field :format "Stipple: %v" 260 (:stipple (editable-field :format "Stipple: %v"
261 :help-echo "Name of background bitmap file.") 261 :help-echo "Name of background bitmap file.")
262 set-face-stipple)) 262 set-face-stipple))
263 "Alist of face attributes. 263 "Alist of face attributes.
264 264