Mercurial > emacs
changeset 42948:74d5b26ad460
(list-colors-display): If the argument is nil, don't
show more colors that the number returned by display-color-cells.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 25 Jan 2002 13:11:49 +0000 |
parents | 76e795715361 |
children | a97674caab35 |
files | lisp/facemenu.el |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/facemenu.el Fri Jan 25 13:10:46 2002 +0000 +++ b/lisp/facemenu.el Fri Jan 25 13:11:49 2002 +0000 @@ -516,14 +516,18 @@ colors to display. Otherwise, this command computes a list of colors that the current display can handle." (interactive) - (when (null list) + (when (and (null list) (> (display-color-cells) 0)) (setq list (defined-colors)) ;; Delete duplicate colors. (let ((l list)) (while (cdr l) (if (facemenu-color-equal (car l) (car (cdr l))) (setcdr l (cdr (cdr l))) - (setq l (cdr l)))))) + (setq l (cdr l))))) + ;; Don't show more than what the display can handle. + (let ((lc (nthcdr (1- (display-color-cells)) list))) + (if lc + (setcdr lc nil)))) (with-output-to-temp-buffer "*Colors*" (save-excursion (set-buffer standard-output)