]> 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 36d95cafe716cabbbf7c96523c4747021b157bd1..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,12 +52,13 @@ 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" "arial" "fixed"))
@@ -64,6 +67,7 @@ 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)
@@ -156,7 +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)
+(make-obsolete 'internal-find-face 'facep "21.1")
 
 
 (defun internal-get-face (name &optional frame)
@@ -170,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-find-face "See `facep' and `check-face'.")
+(make-obsolete 'internal-get-face "See `facep' and `check-face'." "21.1")
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -263,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)
 
 
@@ -450,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'
 
@@ -535,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)
@@ -730,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
@@ -775,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)))
               
@@ -796,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
@@ -810,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)))
 
@@ -836,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)
@@ -867,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")))
@@ -899,7 +916,7 @@ 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 (format "Set font attributes of face %s from font: " face)
+    (completing-read (format "Set font attributes of face `%s' from font: " face)
                     (mapcar 'list (x-list-fonts "*" nil frame)))))
 
 
@@ -919,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))))
 
@@ -931,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)))))
@@ -1043,7 +1060,8 @@ If FRAME is omitted or nil, use the selected frame."
                  (:box . "Box")
                  (:inverse-video . "Inverse")
                  (:stipple . "Stipple")
-                 (:font . "Font or fontset")))
+                 (:font . "Font or fontset")
+                 (:inherit . "Inherit")))
        (max-width (apply #'max (mapcar #'(lambda (x) (length (cdr x)))
                                        attrs))))
     (with-output-to-temp-buffer "*Help*"
@@ -1146,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
@@ -1184,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))
@@ -1228,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
@@ -1269,11 +1287,12 @@ 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)
                 (choice-item light)
@@ -1285,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 (?).
@@ -1293,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
@@ -1469,16 +1486,14 @@ created."
 
 ;; Update a frame's faces when we change its default font.
 
-(defun frame-update-faces (frame)
-  nil)
-(make-obsolete 'frame-update-faces "No longer necessary")
+(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))
-(make-obsolete 'frame-update-face-colors 'frame-set-background-mode)
+(defalias 'frame-update-face-colors 'frame-set-background-mode)
+(make-obsolete 'frame-update-face-colors 'frame-set-background-mode "21.1")
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1498,9 +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"))
+     (:box (:line-width 2 :style released-button)
+          :background "grey75" :foreground "black"))
     (t
      (:inverse-video t)))
   "Basic mode line face."
@@ -1512,10 +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 w32) (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."
@@ -1525,11 +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"))
+     (:box (:line-width 1 :style released-button)
+          :background "grey75" :foreground "black"))
     (t
      ()))
   "Basic tool-bar face."
@@ -1545,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
@@ -1671,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)
@@ -1725,7 +1757,7 @@ created."
 
 (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
@@ -1772,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))
@@ -1793,49 +1825,50 @@ 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)