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

From: Mike Kupfer <[email-masked]>
Date: Tue, 08 Oct 2024 17:09:06 -0700

Stefan Kangas wrote:

> Mike, did you make any progress here?  Thanks in advance.

I finally have some progress to report.

The root cause of the fontification conflict between goto-address and
shr/textsec is that the textsec code uses text properties,
goto-address uses overlays, and overlays override text properties.

So one possible approach to fix this would be for the textsec code to
use overlays, and give the textsec overlay a higher priority than the
goto-address overlay.

I see a couple potential drawbacks with that approach:

1. shr originally used overlays; it was changed to use text properties
because of performance concerns (see
https://lists.gnu.org/r/emacs-diffs/2013-06/msg00215.html).  Of course,
that was over 10 years ago, and processors are faster now.  And maybe
shr could use overlays for the textsec stuff and text properties
everywhere else?

2. AFAICT, there's no system for coordinating overlay priorities across
different packages or subsystems.  I think that makes the priority
mechanism brittle, and for that reason I'm reluctant to use it.

So I lean towards having goto-address leave text alone (don't set an
overlay) if it finds text properties set for the text.

If you have any recommendations or other comments, please let me know.

thanks,
mike