From: Eli Zaretskii Date: Fri, 25 Jan 2002 13:11:49 +0000 (+0000) Subject: (list-colors-display): If the argument is nil, don't X-Git-Tag: ttn-vms-21-2-B4~16983 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6062889d6fd6dc0c74db0559b5d1ec7780740eb3;p=emacs.git (list-colors-display): If the argument is nil, don't show more colors that the number returned by display-color-cells. --- 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)