GNU bug report logs -
#76658
Emacs 27.2; Prioritized invisible overlay is NOT taking precedence over non-prioritized display overlay
Previous Next
Full log
Message #10 received at control <at> debbugs.gnu.org (full text, mbox):
tags 76658 notabug
thanks
> From: "David's Coding Lounge" <davidcodinglounge <at> gmail.com>
> Date: Fri, 28 Feb 2025 18:23:41 -0500
>
> This bug report is essentially taken from my Emacs Stack Exchange post:
> https://emacs.stackexchange.com/questions/83169/why-doesnt-a-prioritized-invisible-overlay-take-precedence-over-non-prioritized
It is not easy to understand what exactly is the issue which you are
reporting and for which you are asking for explanations. Both this
report and the linked postings have a lot of stuff, most of which is
AFAIU irrelevant.
My understanding is that the issue you are asking about is the effect
on display of having both 'display' and 'invisible' property start at
the same buffer position. If this is not the issue you are asking
about, what's below may or may not make sense.
When both 'display' and 'invisible' properties start at the same
buffer position, and the 'display' property is a "replacing" property
(i.e. it instructs Emacs to show something else instead of buffer
text), then the 'display' property "wins", in the sense that the
invisible property is effectively ignored. This happens due to how
the Emacs display engine processes properties:
. it processes 'display' properties before 'invisible'
. when either a replacing 'display' property or 'invisible' property
is found, the display engine completely skips the text covered by
the property, so any other properties in the same text are not
processed
This should explain everything that you see. In particular, overlay
priorities have nothing to do with this, since (as the ELisp manual
says) the priorities are only examined when two or more overlays have
the same property for the same buffer position, which is not the case
here. Also, it explains why, if the 'invisible' property starts
before 'display', it makes all the text invisible, including the
overlay that specifies a 'display' property which shows an image.
If you sometimes need to have the image (defined via the 'display'
property) to vanish from display, simply remove the 'display'
property, or use the conditional 'display' property of the form
'(when CONDITION . DISPLAY-SPEC)' and change Lisp variables that
affect CONDITION.
Bottom line: this is not a bug.
This bug report was last modified 73 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.