Subject: bug#33713: 26.1; Error on list-colors-display

From: martin rudalics <[email-masked]>
Date: Wed, 12 Dec 2018 09:32:24 +0100

> I got this error while using `list-colors-display` with `emcees -Q`.

What is 'emcees'?

 > Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
 >    max()
 >    apply(max nil)
 >    list-colors-display()
 >    funcall-interactively(list-colors-display)
 >    call-interactively(list-colors-display record nil)
 >    command-execute(list-colors-display record)
 >    execute-extended-command(nil "list-colors-display" nil)
 >    funcall-interactively(execute-extended-command nil "list-colors-display" nil)
 >    call-interactively(execute-extended-command nil nil)
 >    command-execute(execute-extended-command)

Can you please try the attached patch?

Thanks, martin
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 7c10d60..6a941ab 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -622,8 +622,9 @@ list-colors-print
 	(setq color (list color)))
       (let* ((opoint (point))
 	     (color-values (color-values (car color)))
-	     (light-p (>= (apply 'max color-values)
-			  (* (car (color-values "white")) .5))))
+	     (light-p (and color-values
+                           (>= (apply 'max color-values)
+			       (* (car (color-values "white")) .5)))))
 	(insert (car color))
 	(indent-to 22)
 	(put-text-property opoint (point) 'face `(:background ,(car color)))