diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-06-28 20:38:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-06-28 20:38:49 +0000 |
commit | 6dfff4846f2bbad4b58ceb6d4973ec9371aec646 (patch) | |
tree | 38158e9971df357aa37f7fbed8b5b60f118c0494 /lisp/faces.el | |
parent | fd4440d30a7e5e7db642d63c889e52caa39bbb12 (diff) | |
download | emacs-6dfff4846f2bbad4b58ceb6d4973ec9371aec646.tar.gz |
(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.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index f08d7631ffa..d2be0537bea 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -634,6 +634,7 @@ If NOERROR is non-nil, return nil on failure." (make-face 'bold-italic) (make-face 'region) (make-face 'secondary-selection) + (make-face 'underline) (setq region-face (face-id 'region)) @@ -697,31 +698,42 @@ If NOERROR is non-nil, return nil on failure." ) (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) |