Subject: bug#60423: 29.0.60; goto-address and shr/textsec don't play nicely together

From: Eli Zaretskii <[email-masked]>
Date: Fri, 11 Oct 2024 08:46:44 +0300

> From: Mike Kupfer <[email-masked]>
> cc: Stefan Monnier <[email-masked]>, [email-masked],
>         [email-masked]
> Comments: In-reply-to Eli Zaretskii <[email-masked]>
>    message dated "Wed, 09 Oct 2024 15:24:02 +0300."
> Date: Thu, 10 Oct 2024 16:46:16 -0700
> 
> Eli Zaretskii wrote:
> 
> > > From: Mike Kupfer <[email-masked]>
> [...]
> > > So I lean towards having goto-address leave text alone (don't set an
> > > overlay) if it finds text properties set for the text.
> > 
> > Not just any properties: only 'face' properties, right?
> 
> Hmm.  shr-tag-a sets these properties, with shr-urlify doing most of the
> work:
> 
> - face ('shr-link')
> - shr-url
> - button
> - category
> - help-echo
> - follow-link
> - mouse-face
> 
> If the URL is suspicious, shr-tag-a also inserts a triangular warning
> symbol with a 'help-echo' property.
> 
> So if I just care about conflicts between goto-address and shr, I guess
> I could just check for the 'shr-link' face.  I'd prefer to have a more
> general test, so I think I want to check for any of
> 
> - face
> - help-echo
> - mouse-face
> 
> and maybe
> 
> - button
> - follow-link
> 
> as well.  What do you think?

AFAIU from your analysis of the problem, it happens because the same
text is covered by both a text property and an overlay with the same
property.  If that is indeed the reason, then the only conflict that I
could see in this situation is for the 'face' property: both shr-tag-a
and goto-address use it, one as a text property and the other as an
overlay property.  The other properties you mention aren't used by
goto-address, so they cannot conflict with what shr-tag-a.  Am I
missing something?

Testing unrelated properties might give us false positives, so I think
we should avoid that.