]> code.delx.au - gnu-emacs/blobdiff - lisp/faces.el
*** empty log message ***
[gnu-emacs] / lisp / faces.el
index d60d30a46f638fab873985a7ca5009a34adb20cd..932e0f3f6e43291f154c11ad97977b1ccee2b4a2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; faces.el --- Lisp faces
 
-;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -66,7 +66,7 @@ a font height that isn't optimal."
   '(("courier" "fixed")
     ("helv" "helvetica" "arial" "fixed"))
   "*Alist of alternative font family names.
-Each element has the the form (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...).
+Each element has 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."
@@ -80,7 +80,8 @@ ALTERNATIVE2 etc."
 ;; This is defined originally in xfaces.c.
 (defcustom face-font-registry-alternatives
   (if (eq system-type 'windows-nt)
-      '(("gb2312.1980" "gb2312")
+      '(("iso8859-1" "ms-oemlatin")
+       ("gb2312.1980" "gb2312")
        ("jisx0208.1990" "jisx0208.1983" "jisx0208.1978")
        ("ksc5601.1989" "ksx1001.1992" "ksc5601.1987")
        ("muletibetan-2" "muletibetan-0"))
@@ -89,7 +90,7 @@ ALTERNATIVE2 etc."
       ("ksc5601.1989" "ksx1001.1992" "ksc5601.1987")
       ("muletibetan-2" "muletibetan-0")))
   "*Alist of alternative font registry names.
-Each element has the the form (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...).
+Each element has the form (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...).
 If fonts of registry REGISTRY can be loaded, font selection
 tries to find a best matching font among all fonts of registry
 REGISTRY, ALTERNATIVE1, ALTERNATIVE2, and etc."
@@ -383,7 +384,7 @@ completely specified)."
     (when (and inherit
               (not (eq inherit t))
               (face-attribute-relative-p attribute value))
-       ;; We should merge with INHERIT as well
+      ;; We should merge with INHERIT as well
       (setq value (face-attribute-merged-with attribute value inherit frame)))
     value))
 
@@ -1124,7 +1125,7 @@ The sample text is a string that comes from the variable
           "Use "
           (if (display-mouse-p) "\\[help-follow-mouse] or ")
           "\\[help-follow] on a face name to customize it\n"
-          "or on its sample text for a decription of the face.\n\n")))
+          "or on its sample text for a description of the face.\n\n")))
        (setq help-xref-stack nil)
        (while faces
          (setq face (car faces))
@@ -1282,19 +1283,21 @@ If SPEC is nil, return nil."
   (unless frame
     (setq frame (selected-frame)))
   (let ((tail spec)
-       result)
+       result all)
     (while tail
       (let* ((entry (pop tail))
             (display (car entry))
             (attrs (cdr entry)))
        (when (face-spec-set-match-display display frame)
-         (setq result (if (listp (car attrs))
+         (setq result (if (null (cdr attrs)) ;; was (listp (car attrs))
                           ;; Old-style entry, the attribute list is the
                           ;; first element.
                           (car attrs)
-                        attrs)
-               tail nil))))
-    result))
+                        attrs))
+         (if (eq display t)
+             (setq all result result nil)
+           (setq tail nil)))))
+    (if all (append result all) result)))
 
 
 (defun face-spec-reset-face (face &optional frame)
@@ -1595,12 +1598,13 @@ Value is the new frame created."
   "Set frame-local faces of FRAME from face specs and resources.
 Initialize colors of certain faces from frame parameters."
   (dolist (face (face-list))
-    (face-spec-set face (face-user-default-spec face) frame)
-    (internal-merge-in-global-face face frame)
-    (when (and (memq window-system '(x w32 mac))
-              (or (not (boundp 'inhibit-default-face-x-resources))
-                  (not (eq face 'default))))
-      (make-face-x-resource-internal face frame)))
+    (when (not (equal face 'default))
+      (face-spec-set face (face-user-default-spec face) frame)
+      (internal-merge-in-global-face face frame)
+      (when (and (memq window-system '(x w32 mac))
+                (or (not (boundp 'inhibit-default-face-x-resources))
+                    (not (eq face 'default))))
+       (make-face-x-resource-internal face frame))))
 
   ;; Initialize attributes from frame parameters.
   (let ((params '((foreground-color default :foreground)
@@ -1702,20 +1706,39 @@ created."
 
 (defface mode-line
   '((((type x w32 mac) (class color))
-     (:box (:line-width -1 :style released-button)
-          :background "grey75" :foreground "black"))
+     :box (:line-width -1 :style released-button)
+     :background "grey75" :foreground "black")
     (t
-     (:inverse-video t)))
-  "Basic mode line face."
+     :inverse-video t))
+  "Basic mode line face for selected window."
   :version "21.1"
   :group 'modeline
   :group 'basic-faces)
 
+(defface mode-line-inactive
+  '((t
+     :inherit mode-line)
+    (((type x w32 mac) (background light) (class color))
+     :weight light
+     :box (:line-width -1 :color "grey75" :style nil)
+     :foreground "grey20" :background "grey90")
+    (((type x w32 mac) (background dark) (class color))
+     :weight light
+     :box (:line-width -1 :color "grey40" :style nil)
+     :foreground "grey80" :background "grey30"))
+  "Basic mode line face for non-selected windows."
+  :version "21.2"
+  :group 'modeline
+  :group 'basic-faces)
+
 ;; Make `modeline' an alias for `mode-line', for compatibility.
 (put 'modeline 'face-alias 'mode-line)
+(put 'modeline-inactive 'face-alias 'mode-line-inactive)
 
 (defface header-line
-  '((((type tty))
+  '((t
+     :inherit mode-line)
+    (((type tty))
      ;; This used to be `:inverse-video t', but that doesn't look very
      ;; good when combined with inverse-video mode-lines and multiple
      ;; windows.  Underlining looks better, and is more consistent with
@@ -1727,27 +1750,21 @@ created."
      ;; the info browser. XXX
      :underline t)
     (((class color grayscale) (background light))
-     :inherit mode-line
      :background "grey90" :foreground "grey20"
      :box nil)
     (((class color grayscale) (background dark))
-     :inherit mode-line
      :background "grey20" :foreground "grey90"
      :box nil)
     (((class mono) (background light))
-     :inherit mode-line
      :background "white" :foreground "black"
      :inverse-video nil
      :box nil
      :underline t)
     (((class mono) (background dark))
-     :inherit mode-line
      :background "black" :foreground "white"
      :inverse-video nil
      :box nil
-     :underline t)
-    (t
-     :inverse-video t))
+     :underline t))
   "Basic header-line face."
   :version "21.1"
   :group 'basic-faces)
@@ -1755,11 +1772,11 @@ created."
 
 (defface tool-bar
   '((((type x w32 mac) (class color))
-     (:box (:line-width 1 :style released-button)
-          :background "grey75" :foreground "black"))
+     :box (:line-width 1 :style released-button)
+     :background "grey75" :foreground "black")
     (((type x) (class mono))
-     (:box (:line-width 1 :style released-button)
-          :background "grey" :foreground "black"))
+     :box (:line-width 1 :style released-button)
+     :background "grey" :foreground "black")
     (t
      ()))
   "Basic tool-bar face."
@@ -1767,16 +1784,26 @@ created."
   :group 'basic-faces)
 
 
+(defface minibuffer-prompt '((((background dark)) :foreground "cyan")
+                            (((type pc)) :foreground "magenta")
+                            (t :foreground "dark blue"))
+  "Face for minibuffer prompts."
+  :version "21.3"
+  :group 'basic-faces)
+
+(setq minibuffer-prompt-properties
+      (append minibuffer-prompt-properties (list 'face 'minibuffer-prompt)))
+
 (defface region
   '((((type tty) (class color))
-     (:background "blue" :foreground "white"))
+     :background "blue" :foreground "white")
     (((type tty) (class mono))
-     (:inverse-video t))
+     :inverse-video t)
     (((class color) (background dark))
-     (:background "blue3"))
+     :background "blue3")
     (((class color) (background light))
-     (:background "lightgoldenrod2"))
-    (t (:background "gray")))
+     :background "lightgoldenrod2")
+    (t :background "gray"))
   "Basic face for highlighting the region."
   :version "21.1"
   :group 'basic-faces)
@@ -1784,11 +1811,11 @@ created."
 
 (defface fringe
   '((((class color) (background light))
-       (:background "grey95"))
-      (((class color) (background dark))
-       (:background "grey10"))
-      (t
-       (:background "gray")))
+     :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
@@ -1836,66 +1863,66 @@ created."
   :group 'basic-faces)
 
 
-(defface bold '((t (:weight bold)))
+(defface bold '((t :weight bold))
   "Basic bold face."
   :group 'basic-faces)
 
 
-(defface italic '((t (:slant italic)))
+(defface italic '((t :slant italic))
   "Basic italic font."
   :group 'basic-faces)
 
 
-(defface bold-italic '((t (:weight bold :slant italic)))
+(defface bold-italic '((t :weight bold :slant italic))
   "Basic bold-italic face."
   :group 'basic-faces)
 
 
-(defface underline '((t (:underline t)))
+(defface underline '((t :underline t))
   "Basic underlined face."
   :group 'basic-faces)
 
 
 (defface highlight
   '((((type tty) (class color))
-     (:background "green"))
+     :background "green")
     (((class color) (background light))
-     (:background "darkseagreen2"))
+     :background "darkseagreen2")
     (((class color) (background dark))
-     (:background "darkolivegreen"))
-    (t (:inverse-video t)))
+     :background "darkolivegreen")
+    (t :inverse-video t))
   "Basic face for highlighting."
   :group 'basic-faces)
 
 
 (defface secondary-selection
   '((((type tty) (class color))
-     (:background "cyan" :foreground "black"))
+     :background "cyan" :foreground "black")
     (((class color) (background light))
-     (:background "yellow"))
+     :background "yellow")
     (((class color) (background dark))
-     (:background "SkyBlue4"))
-    (t (:inverse-video t)))
+     :background "SkyBlue4")
+    (t :inverse-video t))
   "Basic face for displaying the secondary selection."
   :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)
 
 
 (defface trailing-whitespace
   '((((class color) (background light))
-     (:background "red"))
+     :background "red")
     (((class color) (background dark))
-     (:background "red"))
-    (t (:inverse-video t)))
+     :background "red")
+    (t :inverse-video t))
   "Basic face for highlighting trailing whitespace."
   :version "21.1"
   :group 'font-lock                    ; like `show-trailing-whitespace'