changeset 11466:8fb524439d09

(x-defined-colors): Take frame as optional arg. Check whether colors are really supported on the display in use.
author Richard M. Stallman <rms@gnu.org>
date Sun, 16 Apr 1995 04:17:36 +0000
parents 9fa2f8b87890
children bb7c9db199ae
files lisp/term/x-win.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Sun Apr 16 04:15:39 1995 +0000
+++ b/lisp/term/x-win.el	Sun Apr 16 04:17:36 1995 +0000
@@ -490,17 +490,20 @@
 		   "Yellow"
 		   "green yellow"
 		   "GreenYellow")
-  "The full list of X colors from the rgb.text file.")
+  "The full list of X colors from the `rgb.text' file.")
 
-(defun x-defined-colors ()
-  "Return a list of colors supported by the current X-Display."
+(defun x-defined-colors (&optional frame)
+  "Return a list of colors supported for a particular frame.
+The argument FRAME specifies which frame to try.
+The value may be different for frames on different X displays."
+  (or frame (setq frame (selected-frame)))
   (let ((all-colors x-colors)
 	(this-color nil)
 	(defined-colors nil))
     (while all-colors
       (setq this-color (car all-colors)
 	    all-colors (cdr all-colors))
-      (and (x-color-defined-p this-color)
+      (and (face-color-supported-p frame this-color t)
 	   (setq defined-colors (cons this-color defined-colors))))
     defined-colors))