Subject: bug#39115: 26.3; eww consecutive links look like one link with mouse-over

From: Stephen Berman <[email-masked]>
Date: Wed, 22 Jan 2020 20:15:10 +0100

On Wed, 22 Jan 2020 18:31:21 +0200 Eli Zaretskii <[email-masked]> wrote:

>> From: Lars Ingebrigtsen <[email-masked]>
>> Date: Wed, 22 Jan 2020 16:16:05 +0100
>> Cc: [email-masked]
>>
>> I don't know how to fix it, though.  Is there a way to make two
>> consecutive mouse-face regions not light up at the same time when the
>> mouse pointer is over a part of one of the regions?
>
> Not without changes to C-level code, no.  It currently traverses the
> glyphs looking for the first one that doesn't have the mouse-face, so
> if two stretches of text one after the other have that face, it won't
> notice.

That appears to be so only if the respective face values of the
mouse-face properties have the same name; if the face names are
different, even if one inherits from the other so they are visually
indistinguishable, then each propertized string gets highlighted
independently when the mouse pointer hovers over it, e.g. here:

(insert (propertize "one" 'mouse-face 'highlight)
	(propertize "two" 'mouse-face 'header-line-highlight)
	(propertize "three" 'mouse-face 'highlight) ".")

I don't know if it's easy to make e.g. buttons take advantage of this so
you can have consecutive buttons or links with independent mouse
highlighting.

Steve Berman