changeset 3911:06dbadd0e4a7

(face-initialize): Create `underline' face. (x-initialize-frame-faces): Set up `underline' face. (x-initialize-frame-faces): Check x-display-color-p and x-display-planes to decide whether to try using colors or gray.
author Richard M. Stallman <rms@gnu.org>
date Mon, 28 Jun 1993 20:38:49 +0000
parents 22b4b8fcda3e
children 676fb29d1692
files lisp/faces.el
diffstat 1 files changed, 28 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Mon Jun 28 19:56:00 1993 +0000
+++ b/lisp/faces.el	Mon Jun 28 20:38:49 1993 +0000
@@ -634,6 +634,7 @@
   (make-face 'bold-italic)
   (make-face 'region)
   (make-face 'secondary-selection)
+  (make-face 'underline)
 
   (setq region-face (face-id 'region))
 
@@ -697,31 +698,42 @@
       )
 
   (or (face-differs-from-default-p 'highlight frame)
-      (condition-case ()
-	  (condition-case ()
-	      (set-face-background 'highlight "darkseagreen2" frame)
-	    (error (set-face-background 'highlight "green" frame)))
+      (if (or (not (x-display-color-p))
+	      (= (x-display-planes) 1))
+	  (invert-face 'highlight frame)
+	(condition-case ()
+	    (condition-case ()
+		(set-face-background 'highlight "darkseagreen2" frame)
+	      (error (set-face-background 'highlight "green" frame)))
 ;;;	    (set-face-background-pixmap 'highlight "gray1" frame)
-	(error (invert-face 'highlight frame))))
+	  (error (invert-face 'highlight frame)))))
 
   (or (face-differs-from-default-p 'region frame)
-      (condition-case ()
-	  (set-face-background 'region "gray" frame)
-	(error (invert-face 'region frame))))
+      (if (= (x-display-planes) 1)
+	  (invert-face 'region frame)
+	(condition-case ()
+	    (set-face-background 'region "gray" frame)
+	  (error (invert-face 'region frame)))))
 
   (or (face-differs-from-default-p 'modeline frame)
       (invert-face 'modeline frame))
 
+  (or (face-differs-from-default-p 'underline frame)
+      (set-face-underline-p 'underline t frame))
+
   (or (face-differs-from-default-p 'secondary-selection frame)
-      (condition-case ()
-	  (condition-case ()
-	      ;; some older X servers don't have this one.
-	      (set-face-background 'secondary-selection "paleturquoise"
-				   frame)
-	    (error
-	     (set-face-background 'secondary-selection "green" frame)))
+      (if (or (not (x-display-color-p))
+	      (= (x-display-planes) 1))
+	  (invert-face 'secondary-selection frame)
+	(condition-case ()
+	    (condition-case ()
+		;; some older X servers don't have this one.
+		(set-face-background 'secondary-selection "paleturquoise"
+				     frame)
+	      (error
+	       (set-face-background 'secondary-selection "green" frame)))
 ;;;	    (set-face-background-pixmap 'secondary-selection "gray1" frame)
-	(error (invert-face 'secondary-selection frame))))
+	  (error (invert-face 'secondary-selection frame)))))
   )
 
 (defun internal-x-complain-about-font (face frame)