Subject: bug#33398: 26.1, netbsd-8; Hi Lock Faces, Hi Green B, default setting suggestion

From: Eli Zaretskii <[email-masked]>
Date: Sun, 25 Nov 2018 18:46:27 +0200

> From: Juri Linkov <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 24 Nov 2018 23:29:15 +0200
> 
> >>  (defface hi-pink
> >> -  '((((background dark)) (:background "pink" :foreground "black"))
> >> -    (t (:background "pink")))
> >> +  '((((min-colors 88) (background dark))
> >> +     (:background "pink" :foreground "black"))
> >> +    (((background dark)) (:background "red" :foreground "black"))
> >> +    (((min-colors 88)) (:background "pink"))
> >> +    (t (:background "red")))
> >>    "Face for hi-lock mode."
> >>    :group 'hi-lock-faces)
> >
> > Thanks for working on this, but unfortunately changing the default
> > colors for Emacs faces is not that easy (which is why we do that only
> > very rarely).
> 
> I understand that face changing is very sensitive area, so I don't insist
> on these changes if the result is worse.  What I was trying to do is to
> add 2 more default colors: the current 4 is too small number of the default
> background colors, so adding 2 colors will at least cover all available
> 6 non-black-white colors on a 8-color TTY.

Then I don't understand why you also changed the faces we had
already.  Leaving them alone will lower the risk that someone will
become annoyed by the changes.

> emacs -Q -nw --color=8 -f list-colors-display
> 
> displays a list of 8 colors, good.  But running
> 
> emacs -Q -nw --color=16 -f list-colors-display
> 
> displays a list of 256 colors, the same number of colors properly displayed by
> 
> emacs -Q -nw --color=256 -f list-colors-display
> 
> Is this a bug in Emacs?

Not a bug, a subtlety: the only numeric argument you can reliably
submit to --color= is 8, because it alone has a standard set of
termcap/terminfo commands to set and reset colors.  Maybe we should
amend the documentation so that people don't expect other numbers to
work.

> Could you recommend a better way to test a 16-color palette on a
> TTY?

Use a 16-color terminfo entry.

> For the new faces I copied the defface spec conditions from the existing
> faces hi-yellow and hi-green that have separate conditions for less than
> 88 colors.  But we could drop unnecessary conditions here as well.

That some face does have such conditional color definitions doesn't
mean another face also should.  It depends on the results we get on
color-challenged terminals via color translation.