]> 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 942debc106e5631b345aff38740804369a939b4b..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)
 
@@ -274,7 +276,7 @@ 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)
 
 
@@ -1174,7 +1176,8 @@ If FRAME is nil, the current FRAME is used."
 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)))
-    (face-spec-reset-face face frame)
+    (when attrs
+      (face-spec-reset-face face frame))
     (while attrs
       (let ((attribute (car attrs))
            (value (car (cdr attrs))))
@@ -1289,7 +1292,7 @@ this won't have the expected effect."
   :group 'faces
   :set #'(lambda (var value)
           (set-default var value)
-          (mapcar 'frame-set-background-mode (frame-list)))
+          (mapc 'frame-set-background-mode (frame-list)))
   :initialize 'custom-initialize-changed
   :type '(choice (choice-item dark)
                 (choice-item light)
@@ -1526,12 +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" :foreground "black"))
-    (((type w32) (class color))
-     (:box (:line-width 2 :style released-button)
-          :background "grey75" :foreground "black"))
+  '((((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."
@@ -1567,6 +1578,7 @@ created."
      (:background "light goldenrod yellow"))
     (t (:background "gray")))
   "Basic face for highlighting the region."
+  :version "21.1"
   :group 'basic-faces)