diff options
| author | Eli Zaretskii | 2002-01-25 13:11:49 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2002-01-25 13:11:49 +0000 |
| commit | 6062889d6fd6dc0c74db0559b5d1ec7780740eb3 (patch) | |
| tree | 42dde253ef02e219de69443eaba85e4ffcc70276 | |
| parent | 63e9afde34459a5bc653aa1d4bb858f8ff0405df (diff) | |
| download | emacs-6062889d6fd6dc0c74db0559b5d1ec7780740eb3.tar.gz emacs-6062889d6fd6dc0c74db0559b5d1ec7780740eb3.zip | |
(list-colors-display): If the argument is nil, don't
show more colors that the number returned by display-color-cells.
| -rw-r--r-- | lisp/facemenu.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/facemenu.el b/lisp/facemenu.el index c138e13794c..7e44fa5012c 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el | |||
| @@ -516,14 +516,18 @@ If the optional argument LIST is non-nil, it should be a list of | |||
| 516 | colors to display. Otherwise, this command computes a list | 516 | colors to display. Otherwise, this command computes a list |
| 517 | of colors that the current display can handle." | 517 | of colors that the current display can handle." |
| 518 | (interactive) | 518 | (interactive) |
| 519 | (when (null list) | 519 | (when (and (null list) (> (display-color-cells) 0)) |
| 520 | (setq list (defined-colors)) | 520 | (setq list (defined-colors)) |
| 521 | ;; Delete duplicate colors. | 521 | ;; Delete duplicate colors. |
| 522 | (let ((l list)) | 522 | (let ((l list)) |
| 523 | (while (cdr l) | 523 | (while (cdr l) |
| 524 | (if (facemenu-color-equal (car l) (car (cdr l))) | 524 | (if (facemenu-color-equal (car l) (car (cdr l))) |
| 525 | (setcdr l (cdr (cdr l))) | 525 | (setcdr l (cdr (cdr l))) |
| 526 | (setq l (cdr l)))))) | 526 | (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)))) | ||
| 527 | (with-output-to-temp-buffer "*Colors*" | 531 | (with-output-to-temp-buffer "*Colors*" |
| 528 | (save-excursion | 532 | (save-excursion |
| 529 | (set-buffer standard-output) | 533 | (set-buffer standard-output) |