summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-04-16 04:17:36 +0000
committerRichard M. Stallman <rms@gnu.org>1995-04-16 04:17:36 +0000
commit891eb3fef5cdcf690a71619127c029b8c7c949db (patch)
treefabd337e19e6470f5b6a64cb471c366e67e61eca /lisp/term
parent7c49006bee5f3774784fc25b020f341698e4b82e (diff)
downloademacs-891eb3fef5cdcf690a71619127c029b8c7c949db.tar.gz
(x-defined-colors): Take frame as optional arg.
Check whether colors are really supported on the display in use.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/x-win.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 2d6dec473f7..b401909fb2b 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -490,17 +490,20 @@ This returns ARGS with the arguments that have been processed removed."
"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))