diff options
| -rw-r--r-- | lisp/term/x-win.el | 11 |
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." | |||
| 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 | ||