Subject: RE: bug#15899: 24.3.50; regression: `region' overlay is lower priority than default

From: Drew Adams <[email-masked]>
Date: Sat, 16 Nov 2013 10:01:19 -0800 (PST)

> > It's enough for that face to specify a background color, no?
> 
> In some cases, yes, because the region's foreground color is
> often unnoticeable (e.g. same as default).

That's only by default.  We should not base too many assumptions
on any particular face attributes for face `region'.  It is user
customizable.  Better to plan for it to be like any other face:
any attributes at all, at least as much as we can.

> >> I most-positive-fixnum-ly hate overlay priorities.
> > No offense, but I think we can live with that downside ;-)
> 
> The downside is not that I hate it, but the reasons why I hate
> it: it's as much a source of problems as a solution.
> `priorities' impose a total ordering, where often there isn't
> one: in some circumstance one overlay should be on top, in
> others it's the other way around.

I don't disagree (and I'm glad that you are giving reasons ;-)).
But what is a better approach?  A total ordering is black & white,
but at least it gives people a degree of control.  And at least
that control is simple: a total ordering is a simple model.

How about giving an example of a problem?  And a solution -
something that solves that problem and gives users more (not
less) control.

> The "default priority" at least is able to handle those things
> sometimes, by making overlays's ordering depending on nesting.

Not sure what that means, and I wish I did understand what you
mean by that.  Can you give a tiny example to illustrate?

> > In any case, the moment you reimplemented the region as an
> > overlay, you got us this issue, because it is inherent in
> > the use of overlays, and cannot be escaped.
> 
> It was present before as well.  The behavior was different
> but was also a source of "priority problems".

Not clear how so.  Can you elaborate?  Are you referring to
the fact that a user who wants to see some other highlighting
(besides isearch) "on top" could not do so?  That I can see.
If you mean something else then I don't know what it is.

> My intuition tells me that if Emacs had use the current system
> for the last 20 years and had just changed to the "region is
> always at the very top", people would complain just as much.

People sometimes complain less when (a) the new behavior is
proposed and explained and (b) they have an opportunity to
question and discuss it.

We are certainly doing that here, now, but this is something
that would be more appropriate for emacs-devel, IMO.  It would
have been better to initiate a discussion and proposal there,
pointing to the bug report and outlining what the behavior
changes would be.  But you've heard this before...