Subject: Re: bug#25592: Feature request: sorting overlays

From: Clément Pit--Claudel <[email-masked]>
Date: Tue, 7 Feb 2017 15:07:19 -0500

On 2017-02-07 14:56, Eli Zaretskii wrote:
> For the face property, no, because it can have many attributes, and
> they must be merged.  Likewise for before-string and after-string
> properties.  But still, these overlays are applied by the display
> engine in a specific priority order (before-strings in the order of
> increasing priority, after-strings in the decreasing order) at that
> particular locations.  So you need to do the same to produce the same
> effect.

Indeed, but I don't need to re-sort them at each position: I can just sort them once and for all, can't I?

> But for other properties, like the display property, yes, you can
> apply only the highest.

Yup, that makes sense.  

> And that was your original example, AFAIR.

I don't remember; sorry if I was unclear :/  The face property is one of the ones I care most about, because it's one of the few ones for which "text-property-at" isn't enough.

I will try to implement your approach of iterating over ranges of text.  Thanks for all the pointers! Independently of my use case, though, would you object to a patch adding a function that takes a list of overlays from the same buffer and sorts them?

Clément.