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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 03 Feb 2017 23:17:58 +0200

> Cc: [email-masked]
> From: Clément Pit--Claudel <[email-masked]>
> Date: Fri, 3 Feb 2017 10:19:15 -0500
> 
> >> I'm writing a function that copies overlay properties to text properties.
> > 
> > That function probably converts overlays by traversing buffer
> > positions from beginning to end, no?  Then overlays-at should be what
> > you need, and next-overlay-change is your friend to move to the next
> > "interesting" position when you are done with this one.
> > 
> > Isn't that what you are doing?
> 
> No: I'm iterating over all overlays, and applying them one by one.

Why not do it as I suggest?  Then your problems with sorting will be
solved as a nice side-effect.

> >> I reimplemented compare_overlays in ELisp, but that seems brittle.
> > 
> > How did you implement in Lisp the "last resort" of comparison, which
> > compares addresses of the C structs?
> 
> I didn't :)

So it isn't really a solution ;-)