changeset 27571:4a4f7f602836

(display-color-p): Use framep-on-display. (display-grayscale-p): New function.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 02 Feb 2000 11:36:45 +0000
parents 33c77685f4a2
children fa970ad3fb61
files lisp/faces.el
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/faces.el	Wed Feb 02 11:35:43 2000 +0000
+++ b/lisp/faces.el	Wed Feb 02 11:36:45 2000 +0000
@@ -1201,13 +1201,20 @@
 The optional argument DISPLAY specifies which display to ask about.
 DISPLAY should be either a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display."
-  (if (and (stringp display) (not (fboundp 'x-display-list)))
-      nil
-    (if (memq (framep (or display (selected-frame))) '(x w32))
-	(xw-display-color-p display)
-      (tty-display-color-p display))))
+  (if (memq (framep-on-display display) '(x w32))
+      (xw-display-color-p display)
+    (tty-display-color-p display)))
 (defalias 'x-display-color-p 'display-color-p)
 
+(defun display-grayscale-p (&optional display)
+  "Return non-nil if frames on DISPLAY can display shades of gray."
+  (let ((frame-type (framep-on-display display)))
+    (cond
+     ((memq frame-type '(x w32 mac))
+      (x-display-grayscale-p display))
+     (t
+      (> (tty-color-gray-shades display) 2)))))
+
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Background mode.