From 16b6c96620319a25e97e43047a39d2295045e9a6 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Fri, 30 Jul 1999 18:30:04 +0000 Subject: [PATCH] (list-colors-display): Make it work on ttys. --- lisp/facemenu.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 3036e44358c..d0892a99ac6 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -481,15 +481,16 @@ 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) - (if (and (null list) window-system) - (progn - (setq list (x-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))))))) + (when (null list) + (setq list (if window-system + (x-defined-colors) + (tty-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)))))) (with-output-to-temp-buffer "*Colors*" (save-excursion (set-buffer standard-output) -- 2.39.5