516 |
colors to display. Otherwise, this command computes a list |
colors to display. Otherwise, this command computes a list |
517 |
of colors that the current display can handle." |
of colors that the current display can handle." |
518 |
(interactive) |
(interactive) |
519 |
(when (null list) |
(when (and (null list) (> (display-color-cells) 0)) |
520 |
(setq list (defined-colors)) |
(setq list (defined-colors)) |
521 |
;; Delete duplicate colors. |
;; Delete duplicate colors. |
522 |
(let ((l list)) |
(let ((l list)) |
523 |
(while (cdr l) |
(while (cdr l) |
524 |
(if (facemenu-color-equal (car l) (car (cdr l))) |
(if (facemenu-color-equal (car l) (car (cdr l))) |
525 |
(setcdr l (cdr (cdr l))) |
(setcdr l (cdr (cdr l))) |
526 |
(setq l (cdr l)))))) |
(setq l (cdr l))))) |
527 |
|
;; Don't show more than what the display can handle. |
528 |
|
(let ((lc (nthcdr (1- (display-color-cells)) list))) |
529 |
|
(if lc |
530 |
|
(setcdr lc nil)))) |
531 |
(with-output-to-temp-buffer "*Colors*" |
(with-output-to-temp-buffer "*Colors*" |
532 |
(save-excursion |
(save-excursion |
533 |
(set-buffer standard-output) |
(set-buffer standard-output) |