From 6062889d6fd6dc0c74db0559b5d1ec7780740eb3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 25 Jan 2002 13:11:49 +0000 Subject: [PATCH] (list-colors-display): If the argument is nil, don't show more colors that the number returned by display-color-cells. --- lisp/facemenu.el | 8 ++++++-- 1 file 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 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) -- 2.39.5