Subject: Re: bug#19752: 25.0.50; fonts in HTML

From: Eli Zaretskii <[email-masked]>
Date: Sat, 02 Nov 2019 09:45:08 +0200

> From: Stefan Kangas <[email-masked]>
> Date: Sat, 02 Nov 2019 00:40:12 +0100
> Cc: Richard Stallman <[email-masked]>, [email-masked]
> 
> > What does (display-color-cells) return for you?
> 
> FWIW, I tried this on the Linux console and got 8.  I guess ideally
> Richard would try if evaluating the following and see if it solves the
> problem for him:
> 
>     (setq shr-use-colors nil)

This is an option, so "M-x set-variable RET works for it.  No need to
use setq.

More importantly, I think indeed this is on balance the best solution
for these cases.  Emacs automatically maps any color to the closest
available one, but HTML email messages can use color specifications
that will cause both foreground and background convert to the same
colors, which will make the text illegible.

Or maybe shr.el can be taught to use the distant-foreground feature to
handle such cases?

> > -(defcustom shr-use-colors t
> > +(defcustom shr-use-colors (> (display-color-cells) 256)

This is too drastic, IMO.  Most HTML formatted emails use very few
colors and look OK on display even with 8 colors.