GNU bug report logs -
#40821
Margin strings are displayed in reverse order of overlay priority (low-priority specs hide high-priority ones)
Previous Next
Full log
Message #40 received at 40821 <at> debbugs.gnu.org (full text, mbox):
> Cc: 40821 <at> debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
> Date: Wed, 13 May 2020 11:58:26 -0400
>
> (with-current-buffer (get-buffer-create "overlay props")
> (erase-buffer)
> (delete-all-overlays)
> (setq-local left-margin-width 5)
> (save-excursion (insert "test\ntest\n"))
> (let ((ov1 (make-overlay (point-min) (point-max)))
> (ov2 (make-overlay (point-min) (point-at-eol))))
> (overlay-put
> ov1
> 'before-string
> #("!" 0 1 (display
> ((margin left-margin) "c"))))
> (overlay-put
> ov2
> 'before-string
> #("!" 0 1 (display
> ((margin left-margin) "3")))))
> (display-buffer (current-buffer)))
>
> In this example, moving the point back and forth between point-min and 1+ point-min causes the margins to display alternatively "c3" and "3c".
> Is this a bug?
It is not a bug. You haven't defined any priorities, so the sorting
of the overlay strings is arbitrary, and the display engine processes
them in the sorted order. IOW, this is unspecified behavior in
action.
(I can explain why the order changes technically, but it hardly
matters for the more general question.)
This bug report was last modified 5 years and 37 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.