X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fcus-face.el;h=cda39a4ece8e3672714aa19f04200696f87cd887;hp=a4580a93f80f077b0b63baae2359aef5399c2f97;hb=4bff22e9e7b591a8c374edcaddbbc042e25e9731;hpb=5e7997a6d76c547b78021cae664d110ee7a9298c diff --git a/lisp/cus-face.el b/lisp/cus-face.el index a4580a93f..cda39a4ec 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -138,24 +138,57 @@ If the colors are not specified in the face, use the default colors." (set-face-foreground face bg frame) (set-face-background face fg frame))))) -(if (string-match "XEmacs" emacs-version) - ;; XEmacs. +(defcustom custom-background-mode nil + "The brightness of the background. +Set this to the symbol dark if your background color is dark, light if +your background is light, or nil (default) if you want Emacs to +examine the brightness for you." + :group 'customize + :type '(choice (choice-item dark) + (choice-item light) + (choice-item :tag "default" nil))) + +(eval-and-compile + (if (string-match "XEmacs" emacs-version) + ;; XEmacs. + (defun custom-extract-frame-properties (frame) + "Return a plist with the frame properties of FRAME used by custom." + (list 'type (device-type (frame-device frame)) + 'class (device-class (frame-device frame)) + 'background (or custom-background-mode + (frame-property frame + 'background-mode) + (custom-background-mode frame)))) + ;; Emacs. (defun custom-extract-frame-properties (frame) "Return a plist with the frame properties of FRAME used by custom." - (list 'type (device-type (frame-device frame)) - 'class (device-class (frame-device frame)) + (list 'type window-system + 'class (frame-property frame 'display-type) 'background (or custom-background-mode - (frame-property frame - 'background-mode) - (custom-background-mode frame)))) - ;; Emacs. - (defun custom-extract-frame-properties (frame) - "Return a plist with the frame properties of FRAME used by custom." - (list 'type window-system - 'class (frame-property frame 'display-type) - 'background (or custom-background-mode - (frame-property frame 'background-mode) - (custom-background-mode frame))))) + (frame-property frame 'background-mode) + (custom-background-mode frame)))))) + +(defconst custom-face-attributes + '((:bold (toggle :format "Bold: %[%v%]\n") custom-set-face-bold) + (:italic (toggle :format "Italic: %[%v%]\n") custom-set-face-italic) + (:underline + (toggle :format "Underline: %[%v%]\n") set-face-underline-p) + (:foreground (color :tag "Foreground") set-face-foreground) + (:background (color :tag "Background") set-face-background) + (:reverse (const :format "Reverse Video\n" t) + (lambda (face value &optional frame) + ;; We don't use VALUE. + (reverse-face face frame))) + (:stipple (editable-field :format "Stipple: %v") set-face-stipple)) + "Alist of face attributes. + +The elements are of the form (KEY TYPE SET) where KEY is a symbol +identifying the attribute, TYPE is a widget type for editing the +attibute, SET is a function for setting the attribute value. + +The SET function should take three arguments, the face to modify, the +value of the attribute, and optionally the frame where the face should +be changed.") ;;; Declaring a face. @@ -205,28 +238,6 @@ If FRAME is nil, set the default face." (funcall fun face value frame) (error nil))))) -(defconst custom-face-attributes - '((:bold (toggle :format "Bold: %[%v%]\n") custom-set-face-bold) - (:italic (toggle :format "Italic: %[%v%]\n") custom-set-face-italic) - (:underline - (toggle :format "Underline: %[%v%]\n") set-face-underline-p) - (:foreground (color :tag "Foreground") set-face-foreground) - (:background (color :tag "Background") set-face-background) - (:reverse (const :format "Reverse Video\n" t) - (lambda (face value &optional frame) - ;; We don't use VALUE. - (reverse-face face frame))) - (:stipple (editable-field :format "Stipple: %v") set-face-stipple)) - "Alist of face attributes. - -The elements are of the form (KEY TYPE SET) where KEY is a symbol -identifying the attribute, TYPE is a widget type for editing the -attibute, SET is a function for setting the attribute value. - -The SET function should take three arguments, the face to modify, the -value of the attribute, and optionally the frame where the face should -be changed.") - (defun custom-set-face-bold (face value &optional frame) "Set the bold property of FACE to VALUE." (if value @@ -287,16 +298,6 @@ See `defface' for information about SPEC." (put face 'custom-face-display display)) (setq spec nil)))))) -(defcustom custom-background-mode nil - "The brightness of the background. -Set this to the symbol dark if your background color is dark, light if -your background is light, or nil (default) if you want Emacs to -examine the brightness for you." - :group 'customize - :type '(choice (choice-item dark) - (choice-item light) - (choice-item :tag "default" nil))) - (defun custom-background-mode (frame) "Kludge to detect background mode for FRAME." (let* ((bg-resource