]> git.eshelyaron.com Git - emacs.git/commitdiff
(list-colors-display): If the argument is nil, don't
authorEli Zaretskii <eliz@gnu.org>
Fri, 25 Jan 2002 13:11:49 +0000 (13:11 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 25 Jan 2002 13:11:49 +0000 (13:11 +0000)
show more colors that the number returned by display-color-cells.

lisp/facemenu.el

index c138e13794c12798fc59d0b18cd5a00851ade2cb..7e44fa5012ccbdddd833e379e58c74ef3c4fc5ce 100644 (file)
@@ -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)