Subject: bug#16969: Isearch: lazy-highlight face sometimes has foreground and background the same colour.

From: Jan Djärv <[email-masked]>
Date: Sun, 09 Mar 2014 10:37:48 +0100

Hi.

Alan Mackenzie skrev 2014-03-09 00:01:
> Hi, Juri.
>
> On Sat, Mar 08, 2014 at 11:55:45PM +0200, Juri Linkov wrote:
>>> An effective solution would be to give the `lazy-highlight' face a
>>> foreground colour, e.g. black.
>
>> It's useful to keep the foreground color to help seeing the context
>> especially when a match is highlighted on a font-look foreground.
>
> Yes.
>
>> But the problem needs to be fixed anyway.  So maybe we could add the
>> face attribute :distant-foreground to the `lazy-highlight' face
>> that could be applied only when the background color is near to the
>> foreground color like a cyan foreground on a cyan background.
>
> I don't know what ":distant-foreground" means.  It doesn't seem to be in
> the Elisp manual.

You can't have looked very hard.

Faces => Face attributes:

`:distant-foreground'
      Alternative foreground color, a string.  This is like `:foreground'
      but the color is only used as a foreground when the background
      color is near to the foreground that would have been used.  This
      is useful for example when marking text (i.e. the region face).
      If the text has a foreground that is visible with the region face,
      that foreground is used.  If the foreground is near the region
      face background, `:distant-foreground' is used instead so the text
      is readable.

	Jan D.