comparison lisp/term/x-win.el @ 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 95b2cea7c54a
children bad8688c7386
comparison
equal deleted inserted replaced
11465:9fa2f8b87890 11466:8fb524439d09
488 "White" 488 "White"
489 "yellow" 489 "yellow"
490 "Yellow" 490 "Yellow"
491 "green yellow" 491 "green yellow"
492 "GreenYellow") 492 "GreenYellow")
493 "The full list of X colors from the rgb.text file.") 493 "The full list of X colors from the `rgb.text' file.")
494 494
495 (defun x-defined-colors () 495 (defun x-defined-colors (&optional frame)
496 "Return a list of colors supported by the current X-Display." 496 "Return a list of colors supported for a particular frame.
497 The argument FRAME specifies which frame to try.
498 The value may be different for frames on different X displays."
499 (or frame (setq frame (selected-frame)))
497 (let ((all-colors x-colors) 500 (let ((all-colors x-colors)
498 (this-color nil) 501 (this-color nil)
499 (defined-colors nil)) 502 (defined-colors nil))
500 (while all-colors 503 (while all-colors
501 (setq this-color (car all-colors) 504 (setq this-color (car all-colors)
502 all-colors (cdr all-colors)) 505 all-colors (cdr all-colors))
503 (and (x-color-defined-p this-color) 506 (and (face-color-supported-p frame this-color t)
504 (setq defined-colors (cons this-color defined-colors)))) 507 (setq defined-colors (cons this-color defined-colors))))
505 defined-colors)) 508 defined-colors))
506 509
507 ;;;; Function keys 510 ;;;; Function keys
508 511