Subject: bug#64101: 29.0.91; Eglot inlay hints rendered out of order

From: João Távora <[email-masked]>
Date: Tue, 20 Jun 2023 14:50:47 +0100

On Tue, Jun 20, 2023 at 2:34 PM Milan Jovanovic <[email-masked]> wrote:
>
> Well, from reading this thread I expected it to be sorted by priority.

I for one also expected that, though the actual behaviour is defensible
too (not to mention the second problem that Milan reported which stemmed
from my misplaced expectation is now also fixed in emacs-29, hopefully,
I'm just waiting for Milan to confirm).

More specifically, I expected setting monotonically increasing priorities
as one creates coinciding overlays one after the other to have the exactly
the same effect (wrt displaying before-string and after-string)
as creating these overlays _without_ setting priorities on a GNU/Linux system
with the default memory allocation routines (which as Stefan clarified is
a last-resort fallback).

IOW:

(setq a (make-overlay 10 20))
(setq b (make-overlay 10 20))
(overlay-put a 'after-string "aaa")
(overlay-put b 'after-string "bbb")

has a half-predictable effect on Linux.  In fact it displays
exactly the same as doing that with 'before-string'.

I would expect that adding

(overlay-put a 'priority 1)
(overlay-put b 'priority 2)

would have now a fully-predictable _same_ effect on every system.  The
fully-predictable requirement is fullfilled alright, but the display order
is reversed if 'after-string' is used.

But, again, I guess the behaviour _with_ priorities is defensible too.
Though it's not really obvious.

João