]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
(header-line): Change defaults to be less confusing when mixed with mode-lines.
[gnu-emacs] / lisp / faces.el
index dadfe68e62358ce3659274b07b3e6b06f7a5d78c..d50600c4a6c6eb970f3f36a2a646ca89dc445576 100644 (file)
@@ -25,7 +25,9 @@
 ;;; Code:
 
 (eval-when-compile
-  (require 'cl))
+  (require 'cl)
+  ;; Warning suppression -- can't require x-win in batch:
+  (autoload 'xw-defined-colors "x-win"))
 
 (require 'cus-face)
 
@@ -50,20 +52,22 @@ example, if `:slant' appears before `:height', font selection first
 tries to find a font with a suitable slant, even if this results in
 a font height that isn't optimal."
   :tag "Font selection order."
+  :type '(list symbol symbol symbol symbol)
   :group 'font-selection
   :set #'(lambda (symbol value)
           (set-default symbol value)
           (internal-set-font-selection-order value)))
 
-
+;; This is defined originally in {w32,x}faces.c.
 (defcustom face-font-family-alternatives
   '(("courier" "fixed")
-    ("helv" "helvetica" "fixed"))
+    ("helv" "helvetica" "arial" "fixed"))
   "*Alist of alternative font family names.
 Each element has the the form (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...).
 If fonts of family FAMILY can't be loaded, try ALTERNATIVE1, then
 ALTERNATIVE2 etc."
   :tag "Alternative font families to try."
+  :type '(repeat (repeat string))
   :group 'font-selection
   :set #'(lambda (symbol value)
           (set-default symbol value)
@@ -143,7 +147,7 @@ to NEW-FACE on frame NEW-FRAME."
 
 ;; The functions in this section are defined because Lisp packages use
 ;; them, despite the prefix `internal-' suggesting that they are
-;; private to the face implementation.  
+;; private to the face implementation.
 
 (defun internal-find-face (name &optional frame)
   "Retrieve the face named NAME.
@@ -156,6 +160,7 @@ If NAME is already a face, it is simply returned.
 This function is defined for compatibility with Emacs 20.2.  It
 should not be used anymore."
   (facep name))
+(make-obsolete 'internal-find-face 'facep "21.1")
 
 
 (defun internal-get-face (name &optional frame)
@@ -169,7 +174,7 @@ This function is defined for compatibility with Emacs 20.2.  It
 should not be used anymore."
   (or (internal-find-face name frame)
       (check-face name)))
-
+(make-obsolete 'internal-get-face "See `facep' and `check-face'." "21.1")
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -262,16 +267,16 @@ If FRAME is omitted or nil, use the selected frame."
     (:stipple
      (".attributeStipple" . "Face.AttributeStipple")
      (".attributeBackgroundPixmap" . "Face.AttributeBackgroundPixmap"))
-    (:font (".attributeFont" . "Face.AttributeFont"))
     (:bold (".attributeBold" . "Face.AttributeBold"))
     (:italic (".attributeItalic" . "Face.AttributeItalic"))
-    (:font (".attributeFont" . "Face.AttributeFont")))
+    (:font (".attributeFont" . "Face.AttributeFont"))
+    (:inherit (".attributeInherit" . "Face.AttributeInherit")))
   "*List of X resources and classes for face attributes.
 Each element has the form (ATTRIBUTE ENTRY1 ENTRY2...) where ATTRIBUTE is
 the name of a face attribute, and each ENTRY is a cons of the form
 (RESOURCE . CLASS) with RESOURCE being the resource and CLASS being the
 X resource class for the attribute."
-  :type 'sexp
+  :type '(repeat (cons symbol (repeat (cons string string))))
   :group 'faces)
 
 
@@ -449,8 +454,10 @@ It must be one of the symbols `ultra-condensed', `extra-condensed',
 
 `:height'
 
-VALUE must be an integer specifying the height of the font to use in
-1/10 pt.
+VALUE must be either an integer specifying the height of the font to use
+in 1/10 pt, a floating point number specifying the amount by which to
+scale any underlying face, or a function, which is called with the old
+height (from the underlying face), and should return the new height.
 
 `:weight'
 
@@ -512,7 +519,7 @@ box.
 `:inverse-video'
 
 VALUE specifies whether characters in FACE should be displayed in
-inverse video. VALUE must be one of t or nil.
+inverse video.  VALUE must be one of t or nil.
 
 `:stipple'
 
@@ -534,20 +541,20 @@ will be used.
 
 For compatibility with Emacs 20, keywords `:bold' and `:italic' can
 be used to specify that a bold or italic font should be used.  VALUE
-must be t or nil in that case.  A value of `unspecified' is not allowed."
-  (setq args (purecopy args))
-  (cond ((null frame)
-        ;; Change face on all frames.
-        (dolist (frame (frame-list))
-          (apply #'set-face-attribute face frame args))
-        ;; Record that as a default for new frames.
-        (apply #'set-face-attribute face t args))
-       (t
-        (while args
-          (internal-set-lisp-face-attribute face (car args)
-                                            (purecopy (cadr args))
-                                            frame)
-          (setq args (cdr (cdr args)))))))
+must be t or nil in that case.  A value of `unspecified' is not allowed.
+
+`:inherit'
+
+VALUE is the name of a face from which to inherit attributes, or a list
+of face names.  Attributes from inherited faces are merged into the face
+like an underlying face would be, with higher priority than underlying faces."
+  (let ((where (if (null frame) 0 frame)))
+    (setq args (purecopy args))
+    (while args
+      (internal-set-lisp-face-attribute face (car args)
+                                       (purecopy (cadr args))
+                                       where)
+      (setq args (cdr (cdr args))))))
 
 
 (defun make-face-bold (face &optional frame noerror)
@@ -578,7 +585,8 @@ Use `set-face-attribute' for finer control of the font slant."
 
 (defun make-face-unitalic (face &optional frame noerror)
   "Make the font of FACE be non-italic, if possible.
-FRAME nil or not specified means change face on all frames."
+FRAME nil or not specified means change face on all frames.
+Argument NOERROR is ignored and retained for compatibility."
   (interactive (list (read-face-name "Make which face non-italic ")))
   (set-face-attribute face frame :slant 'normal))
 
@@ -624,7 +632,7 @@ When called interactively, prompt for the face and color."
 (defun set-face-stipple (face stipple &optional frame)
   "Change the stipple pixmap of face FACE to STIPPLE.
 FRAME nil or not specified means change face on all frames.
-STIPPLE. should be a string, the name of a file of pixmap data.
+STIPPLE should be a string, the name of a file of pixmap data.
 The directories listed in the `x-bitmap-file-path' variable are searched.
 
 Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA)
@@ -728,7 +736,7 @@ Value is a symbol naming a known face."
        (def (thing-at-point 'symbol))
        face)
     (cond ((assoc def face-list)
-          (setq prompt (concat prompt "(default " def "): ")))
+          (setq prompt (concat prompt " (default " def "): ")))
          (t (setq def nil)
             (setq prompt (concat prompt ": "))))
     (while (equal "" (setq face (completing-read
@@ -773,9 +781,13 @@ an integer value."
                  (mapcar #'list
                          (apply #'nconc (mapcar #'directory-files
                                                 x-bitmap-file-path)))))
+           (:inherit
+            (cons '("none" . nil)
+                  (mapcar #'(lambda (c) (cons (symbol-name c) c))
+                          (face-list))))
            (t
             (error "Internal error"))))
-    (if (listp valid)
+    (if (and (listp valid) (not (memq attribute '(:inherit))))
        (nconc (list (cons "unspecified" 'unspecified)) valid)
       valid)))
               
@@ -794,7 +806,8 @@ an integer value."
     (:inverse-video . "inverse-video display")
     (:foreground . "foreground color")
     (:background . "background color")
-    (:stipple . "background stipple"))
+    (:stipple . "background stipple")
+    (:inherit . "inheritance"))
   "An alist of descriptive names for face attributes.
 Each element has the form (ATTRIBUTE-NAME . DESCRIPTION) where
 ATTRIBUTE-NAME is a face attribute name (a keyword symbol), and
@@ -808,21 +821,22 @@ DESCRIPTION is a descriptive name for ATTRIBUTE-NAME.")
 
 (defun face-read-string (face default name &optional completion-alist)
   "Interactively read a face attribute string value.
-FACE is the face whose attribute is read.  DEFAULT is the default
-value to return if no new value is entered.  NAME is a descriptive
-name of the attribute for prompting.  COMPLETION-ALIST is an alist
-of valid values, if non-nil.
+FACE is the face whose attribute is read.  If non-nil, DEFAULT is the
+default string to return if no new value is entered.  NAME is a
+descriptive name of the attribute for prompting.  COMPLETION-ALIST is an
+alist of valid values, if non-nil.
 
-Entering nothing accepts the default value DEFAULT.
+Entering nothing accepts the default string DEFAULT.
 Value is the new attribute value."
+  ;; Capitalize NAME (we don't use `capitalize' because that capitalizes
+  ;; each word in a string separately).
+  (setq name (concat (upcase (substring name 0 1)) (substring name 1)))
   (let* ((completion-ignore-case t)
         (value (completing-read
                 (if default
-                    (format "Set face %s %s (default %s): "
-                            face name (downcase (if (symbolp default)
-                                                    (symbol-name default)
-                                                  default)))
-                  (format "Set face %s %s: " face name))
+                    (format "%s for face `%s' (default %s): "
+                            name face default)
+                  (format "%s for face `%s': " name face))
                 completion-alist)))
     (if (equal value "") default value)))
 
@@ -834,17 +848,15 @@ value to return if no new value is entered.  NAME is a descriptive
 name of the attribute for prompting.  Value is the new attribute value."
   (let ((new-value
         (face-read-string face
-                          (if (memq default
-                                    '(unspecified
-                                      "unspecified-fg"
-                                      "unspecified-bg"))
-                              default
-                            (int-to-string default))
+                          (format "%s" default)
                           name
                           (list (cons "unspecified" 'unspecified)))))
-    (if (memq new-value '(unspecified "unspecified-fg" "unspecified-bg"))
-       new-value
-      (string-to-int new-value))))
+    (cond ((equal new-value "unspecified")
+          'unspecified)
+         ((member new-value '("unspecified-fg" "unspecified-bg"))
+          new-value)
+         (t
+          (string-to-int new-value)))))
 
 
 (defun read-face-attribute (face attribute &optional frame)
@@ -865,20 +877,27 @@ of a global face.  Value is the new attribute value."
                   (vectorp old-value)))
       (setq old-value (prin1-to-string old-value)))
     (cond ((listp valid)
-          (setq new-value
-                (face-read-string face old-value attribute-name valid))
-          ;; Terminal frames can support colors that don't appear
-          ;; explicitly in VALID, using color approximation code
-          ;; in tty-colors.el.
-          (if (and (memq attribute '(:foreground :background))
-                   (not (memq window-system '(x w32 mac)))
-                   (not (memq new-value
-                              '(unspecified
-                                "unspecified-fg"
-                                "unspecified-bg"))))
-              (setq new-value (car (tty-color-desc new-value frame))))
-          (unless (eq new-value 'unspecified)
-            (setq new-value (cdr (assoc new-value valid)))))
+          (let ((default
+                  (or (car (rassoc old-value valid))
+                      (format "%s" old-value))))
+            (setq new-value
+                  (face-read-string face default attribute-name valid))
+            (if (equal new-value default)
+                ;; Nothing changed, so don't bother with all the stuff
+                ;; below.  In particular, this avoids a non-tty color
+                ;; from being canonicalized for a tty when the user
+                ;; just uses the default.
+                (setq new-value old-value)
+              ;; Terminal frames can support colors that don't appear
+              ;; explicitly in VALID, using color approximation code
+              ;; in tty-colors.el.
+              (if (and (memq attribute '(:foreground :background))
+                       (not (memq window-system '(x w32 mac)))
+                       (not (member new-value
+                                    '("unspecified"
+                                      "unspecified-fg" "unspecified-bg"))))
+                  (setq new-value (car (tty-color-desc new-value frame))))
+              (setq new-value (cdr (assoc new-value valid))))))
          ((eq valid 'integerp)
           (setq new-value (face-read-integer face old-value attribute-name)))
          (t (error "Internal error")))
@@ -897,8 +916,8 @@ of a global face.  Value is the new attribute value."
   "Read the name of a font for FACE on FRAME.
 If optional argument FRAME Is nil or omitted, use the selected frame."
   (let ((completion-ignore-case t))
-    (completing-read "Set font attributes of face %s from font: "
-                    face (x-list-fonts "*" nil frame))))
+    (completing-read (format "Set font attributes of face `%s' from font: " face)
+                    (mapcar 'list (x-list-fonts "*" nil frame)))))
 
 
 (defun read-all-face-attributes (face &optional frame)
@@ -917,7 +936,7 @@ Value is a property list of attribute names and new values."
 If optional argument FRAME is nil or omitted, modify the face used
 for newly created frame, i.e. the global face."
   (interactive)
-  (let ((face (read-face-name "Modify face ")))
+  (let ((face (read-face-name "Modify face")))
     (apply #'set-face-attribute face frame
           (read-all-face-attributes face frame))))
 
@@ -929,13 +948,13 @@ FRAME nil or unspecified means read attribute value of global face.
 Value is a list (FACE NEW-VALUE) where FACE is the face read
 (a symbol), and NEW-VALUE is value read."
   (cond ((eq attribute :font)
-        (let* ((prompt (format "Set font-related attributes of face "))
+        (let* ((prompt "Set font-related attributes of face")
                (face (read-face-name prompt))
                (font (read-face-font face frame)))
           (list face font)))
        (t
         (let* ((attribute-name (face-descriptive-attribute-name attribute))
-               (prompt (format "Set %s of face " attribute-name))
+               (prompt (format "Set %s of face" attribute-name))
                (face (read-face-name prompt))
                (new-value (read-face-attribute face attribute frame)))
           (list face new-value)))))
@@ -972,7 +991,7 @@ The sample text is a string that comes from the variable
          (concat
           "Use "
           (if (display-mouse-p) "\\[help-follow-mouse] or ")
-          "\\[help-follow] or on a face name to customize it\n"
+          "\\[help-follow] on a face name to customize it\n"
           "or on its sample text for a decription of the face.\n\n")))
        (setq help-xref-stack nil)
        (while faces
@@ -985,14 +1004,20 @@ The sample text is a string that comes from the variable
          (save-excursion
            (save-match-data
              (search-backward face-name)
-             (help-xref-button 0 #'customize-face face-name)))
+             (help-xref-button 0 (lambda (f)
+                                   (if help-xref-stack
+                                       (pop help-xref-stack))
+                                   (customize-face f))
+                               face-name
+                               "mouse-2: customize this face")))
          (let ((beg (point)))
            (insert list-faces-sample-text)
            ;; Hyperlink to a help buffer for the face.
            (save-excursion
              (save-match-data
                (search-backward list-faces-sample-text)
-               (help-xref-button 0 #'describe-face face)))
+               (help-xref-button 0 #'describe-face face
+                                 "mouse-2: describe this face")))
            (insert "\n")
            (put-text-property beg (1- (point)) 'face face)
            ;; If the sample text has multiple lines, line up all of them.
@@ -1021,7 +1046,7 @@ The sample text is a string that comes from the variable
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (interactive (list (read-face-name "Describe face ")))
+  (interactive (list (read-face-name "Describe face")))
   (let* ((attrs '((:family . "Family")
                  (:width . "Width")
                  (:height . "Height")
@@ -1034,7 +1059,9 @@ If FRAME is omitted or nil, use the selected frame."
                  (:strike-through . "Strike-through")
                  (:box . "Box")
                  (:inverse-video . "Inverse")
-                 (:stipple . "Stipple")))
+                 (:stipple . "Stipple")
+                 (:font . "Font or fontset")
+                 (:inherit . "Inherit")))
        (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x)))
                                        attrs))))
     (with-output-to-temp-buffer "*Help*"
@@ -1046,11 +1073,21 @@ If FRAME is omitted or nil, use the selected frame."
                    (cdr a) ": " (format "%s" attr) "\n")))
        (insert "\nDocumentation:\n\n"
                (or (face-documentation face)
-                   "not documented as a face.")))
-      (print-help-return-message))))
-  
-
-
+                   "not documented as a face."))
+       (let ((customize-label "customize"))
+         (terpri)
+         (terpri)
+         (princ (concat "You can " customize-label " this face."))
+         (with-current-buffer "*Help*"
+           (save-excursion
+             (re-search-backward
+              (concat "\\(" customize-label "\\)") nil t)
+             (help-xref-button 1 #'customize-face face
+                               "mouse-2, RET: customize face")))))
+      (print-help-return-message)
+      (with-current-buffer "*Help*"
+       (help-setup-xref (list #'describe-face face) (interactive-p))
+       (buffer-string)))))
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Face specifications (defface).
@@ -1104,7 +1141,7 @@ If FRAME is nil, the current FRAME is used."
                        ((eq req 'background)
                         (memq (frame-parameter frame 'background-mode)
                               options))
-                       (t (error "Unknown req `%S' with options `%S'" 
+                       (t (error "Unknown req `%S' with options `%S'"
                                  req options)))))
     match))
 
@@ -1127,36 +1164,36 @@ If FRAME is nil, the current FRAME is used."
 
 (defun face-spec-reset-face (face &optional frame)
   "Reset all attributes of FACE on FRAME to unspecified."
-  (let ((attrs face-attribute-name-alist)
-       params)
+  (let ((attrs face-attribute-name-alist))
     (while attrs
       (let ((attr-and-name (car attrs)))
-       (setq params (cons (car attr-and-name) (cons 'unspecified params))))
-      (setq attrs (cdr attrs)))
-    (apply #'set-face-attribute face frame params)))
+       (set-face-attribute face frame (car attr-and-name) 'unspecified))
+      (setq attrs (cdr attrs)))))
 
 
 (defun face-spec-set (face spec &optional frame)
   "Set FACE's attributes according to the first matching entry in SPEC.
 FRAME is the frame whose frame-local face is set.  FRAME nil means
 do it on all frames.  See `defface' for information about SPEC."
-  (let ((attrs (face-spec-choose spec frame))
-       params)
+  (let ((attrs (face-spec-choose spec frame)))
+    (when attrs
+      (face-spec-reset-face face frame))
     (while attrs
       (let ((attribute (car attrs))
            (value (car (cdr attrs))))
        ;; Support some old-style attribute names and values.
        (case attribute
          (:bold (setq attribute :weight value (if value 'bold 'normal)))
-         (:italic (setq attribute :slant value (if value 'italic 'normal))))
-       (setq params (cons attribute (cons value params))))
-      (setq attrs (cdr (cdr attrs))))
-    (face-spec-reset-face face frame)
-    (apply #'set-face-attribute face frame params)))
+         (:italic (setq attribute :slant value (if value 'italic 'normal)))
+         (t (unless (assq attribute face-x-resources)
+              (setq attribute nil))))
+       (when attribute
+         (set-face-attribute face frame attribute value)))
+      (setq attrs (cdr (cdr attrs))))))
 
 
 (defun face-attr-match-p (face attrs &optional frame)
-  "Value is non-nil if attributes of FACE match values in plist ATTRS.
+  "Return t if attributes of FACE match values in plist ATTRS.
 Optional parameter FRAME is the frame whose definition of FACE
 is used.  If nil or omitted, use the selected frame."
   (unless frame
@@ -1165,14 +1202,15 @@ is used.  If nil or omitted, use the selected frame."
        (match t))
     (while (and match (not (null list)))
       (let* ((attr (car (car list)))
-            (specified-value (plist-get attrs attr))
+            (specified-value
+             (if (plist-member attrs attr)
+                 (plist-get attrs attr)
+               'unspecified))
             (value-now (face-attribute face attr frame)))
-       (when specified-value
-         (setq match (equal specified-value value-now)))
+       (setq match (equal specified-value value-now))
        (setq list (cdr list))))
     match))
 
-
 (defun face-spec-match-p (face spec &optional frame)
   "Return t if FACE, on FRAME, matches what SPEC says it should look like."
   (face-attr-match-p face (face-spec-choose spec frame) frame))
@@ -1209,8 +1247,7 @@ If COLOR is the symbol `unspecified' or one of the strings
 (defun color-values (color &optional frame)
   "Return a description of the color named COLOR on frame FRAME.
 The value is a list of integer RGB values--\(RED GREEN BLUE\).
-These values appear to range from 0 to 65280 or 65535, depending
-on the system; white is \(65280 65280 65280\) or \(65535 65535 65535\).
+These values appear to range from 0 65535; white is \(65535 65535 65535\).
 If FRAME is omitted or nil, use the selected frame.
 If FRAME cannot display COLOR, the value is nil.
 If COLOR is the symbol `unspecified' or one of the strings
@@ -1250,13 +1287,14 @@ If omitted or nil, that stands for the selected frame's display."
   "*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."
+examine the brightness for you.  Don't set this variable with `setq';
+this won't have the expected effect."
   :group 'faces
   :set #'(lambda (var value)
-          (set var value)
-          (mapcar 'frame-set-background-mode (frame-list)))
+          (set-default var value)
+          (mapc 'frame-set-background-mode (frame-list)))
   :initialize 'custom-initialize-changed
-  :type '(choice (choice-item dark) 
+  :type '(choice (choice-item dark)
                 (choice-item light)
                 (choice-item :tag "default" nil)))
 
@@ -1266,7 +1304,6 @@ examine the brightness for you."
   (let* ((bg-resource
          (and window-system
               (x-get-resource ".backgroundMode" "BackgroundMode")))
-        (params (frame-parameters frame))
         (bg-mode (cond (frame-background-mode)
                        ((null window-system)
                         ;; No way to determine this automatically (?).
@@ -1274,8 +1311,7 @@ examine the brightness for you."
                        (bg-resource
                         (intern (downcase bg-resource)))
                        ((< (apply '+ (x-color-values
-                                      (cdr (assq 'background-color
-                                                 params))
+                                      (frame-parameter frame 'background-color)
                                       frame))
                            ;; Just looking at the screen, colors whose
                            ;; values add up to .6 of the white total
@@ -1450,16 +1486,14 @@ created."
 
 ;; Update a frame's faces when we change its default font.
 
-(defun frame-update-faces (frame)
-  nil)
-
+(defalias 'frame-update-faces 'ignore)
+(make-obsolete 'frame-update-faces "No longer necessary" "21.1")
 
 ;; Update the colors of FACE, after FRAME's own colors have been
 ;; changed.
 
-(defun frame-update-face-colors (frame)
-  (frame-set-background-mode frame))
-
+(defalias 'frame-update-face-colors 'frame-set-background-mode)
+(make-obsolete 'frame-update-face-colors 'frame-set-background-mode "21.1")
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1479,7 +1513,11 @@ created."
 
 (defface mode-line
   '((((type x) (class color))
-     (:box (:line-width 2 :style released-button) :background "grey75"))
+     (:box (:line-width 2 :style released-button)
+          :background "grey75" :foreground "black"))
+    (((type w32) (class color))
+     (:box (:line-width 2 :style released-button)
+          :background "grey75" :foreground "black"))
     (t
      (:inverse-video t)))
   "Basic mode line face."
@@ -1491,8 +1529,20 @@ created."
 (put 'modeline 'face-alias 'mode-line)
 
 (defface header-line
-  '((((type x) (class color))
-     (:box (:line-width 2 :style released-button) :background "grey75"))
+  '((((type tty))
+     (:inverse-video t))
+    (((class color) (background light))
+     (:box (:line-width 1 :style released-button)
+          :background "grey90"
+          :inherit mode-line))
+    (((class color) (background dark))
+     (:box (:line-width 1 :style released-button)
+          :background "grey20"
+          :inherit mode-line))
+    (((class mono))
+     (:box (:line-width 1 :style released-button)
+          :background "grey"
+          :inherit mode-line))
     (t
      (:inverse-video t)))
   "Basic header-line face."
@@ -1502,9 +1552,14 @@ created."
 
 (defface tool-bar
   '((((type x) (class color))
-     (:box (:line-width 1 :style released-button) :background "grey75"))
+     (:box (:line-width 1 :style released-button)
+          :background "grey75" :foreground "black"))
     (((type x) (class mono))
-     (:box (:line-width 1 :style released-button) :background "grey"))
+     (:box (:line-width 1 :style released-button)
+          :background "grey" :foreground "black"))
+    (((type w32) (class color))
+     (:box (:line-width 1 :style released-button)
+          :background "grey75" :foreground "black"))
     (t
      ()))
   "Basic tool-bar face."
@@ -1520,17 +1575,20 @@ created."
     (((class color) (background dark))
      (:background "blue"))
     (((class color) (background light))
-     (:background "lightblue"))
+     (:background "light goldenrod yellow"))
     (t (:background "gray")))
   "Basic face for highlighting the region."
+  :version "21.1"
   :group 'basic-faces)
 
 
 (defface fringe
-  '((((class color))
-     (:background "grey95"))
-    (t
-     (:background "gray")))
+  '((((class color) (background light))
+       (:background "grey95"))
+      (((class color) (background dark))
+       (:background "grey10"))
+      (t
+       (:background "gray")))
   "Basic face for the fringes to the left and right of windows under X."
   :version "21.1"
   :group 'frames
@@ -1618,12 +1676,12 @@ created."
   :group 'basic-faces)
 
 
-(defface fixed-pitch '((t (:family "courier*")))
+(defface fixed-pitch '((t (:family "courier")))
   "The basic fixed-pitch face."
   :group 'basic-faces)
 
 
-(defface variable-pitch '((t (:family "helv*")))
+(defface variable-pitch '((t (:family "helv")))
   "The basic variable-pitch face."
   :group 'basic-faces)
 
@@ -1646,9 +1704,8 @@ created."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; This is here for compatibilty with Emacs 20.2.  For example,
-;; international/fontset.el uses these functions to manipulate font
-;; names.  The following functions are not used in the face
-;; implementation itself.
+;; international/fontset.el uses x-resolve-font-name.  The following
+;; functions are not used in the face implementation itself.
 
 (defvar x-font-regexp nil)
 (defvar x-font-regexp-head nil)
@@ -1695,12 +1752,12 @@ created."
                "\\([-*?]\\|\\'\\)"))
   (setq x-font-regexp-slant (concat - slant -))
   (setq x-font-regexp-weight (concat - weight -))
-  nil)     
+  nil)
 
 
 (defun x-resolve-font-name (pattern &optional face frame)
   "Return a font name matching PATTERN.
-All wildcards in PATTERN become substantiated.
+All wildcards in PATTERN are instantiated.
 If PATTERN is nil, return the name of the frame's base font, which never
 contains wildcards.
 Given optional arguments FACE and FRAME, return a font which is
@@ -1747,7 +1804,7 @@ also the same size as FACE on FRAME, or fail."
          ((string-match x-font-regexp-weight font)
           (concat (substring font 0 (match-beginning 1)) which
                   (substring font (match-end 1)))))))
-
+(make-obsolete 'x-frob-font-weight 'make-face-... "21.1")
 
 (defun x-frob-font-slant (font which)
   (let ((case-fold-search t))
@@ -1768,51 +1825,51 @@ also the same size as FACE on FRAME, or fail."
          ((string-match x-font-regexp-slant font)
           (concat (substring font 0 (match-beginning 1)) which
                   (substring font (match-end 1)))))))
-
+(make-obsolete 'x-frob-font-slant 'make-face-... "21.1")
 
 (defun x-make-font-bold (font)
   "Given an X font specification, make a bold version of it.
 If that can't be done, return nil."
   (x-frob-font-weight font "bold"))
-
+(make-obsolete 'x-make-font-bold 'make-face-bold "21.1")
 
 (defun x-make-font-demibold (font)
   "Given an X font specification, make a demibold version of it.
 If that can't be done, return nil."
   (x-frob-font-weight font "demibold"))
-
+(make-obsolete 'x-make-font-demibold 'make-face-bold "21.1")
 
 (defun x-make-font-unbold (font)
   "Given an X font specification, make a non-bold version of it.
 If that can't be done, return nil."
   (x-frob-font-weight font "medium"))
-
+(make-obsolete 'x-make-font-unbold 'make-face-unbold "21.1")
 
 (defun x-make-font-italic (font)
   "Given an X font specification, make an italic version of it.
 If that can't be done, return nil."
   (x-frob-font-slant font "i"))
-
+(make-obsolete 'x-make-font-italic 'make-face-italic "21.1")
 
 (defun x-make-font-oblique (font) ; you say tomayto...
   "Given an X font specification, make an oblique version of it.
 If that can't be done, return nil."
   (x-frob-font-slant font "o"))
-
+(make-obsolete 'x-make-font-oblique 'make-face-italic "21.1")
 
 (defun x-make-font-unitalic (font)
   "Given an X font specification, make a non-italic version of it.
 If that can't be done, return nil."
   (x-frob-font-slant font "r"))
-
+(make-obsolete 'x-make-font-unitalic 'make-face-unitalic "21.1")
 
 (defun x-make-font-bold-italic (font)
   "Given an X font specification, make a bold and italic version of it.
 If that can't be done, return nil."
   (and (setq font (x-make-font-bold font))
        (x-make-font-italic font)))
-
+(make-obsolete 'x-make-font-bold-italic 'make-face-bold-italic "21.1")
 
 (provide 'faces)
 
-;;; end of faces.el
+;;; faces.el ends here