diff options
| author | Richard M. Stallman | 1995-04-16 04:17:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-16 04:17:36 +0000 |
| commit | 891eb3fef5cdcf690a71619127c029b8c7c949db (patch) | |
| tree | fabd337e19e6470f5b6a64cb471c366e67e61eca | |
| parent | 7c49006bee5f3774784fc25b020f341698e4b82e (diff) | |
| download | emacs-891eb3fef5cdcf690a71619127c029b8c7c949db.tar.gz emacs-891eb3fef5cdcf690a71619127c029b8c7c949db.zip | |
(x-defined-colors): Take frame as optional arg.
Check whether colors are really supported on the display in use.
| -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 | ||