Subject: bug#71030: Display property of overlay-arrow-string is not honored

From: Eli Zaretskii <[email-masked]>
Date: Sun, 19 May 2024 11:39:36 +0300

> From: Emre Yolcu <[email-masked]>
> Date: Sat, 18 May 2024 13:33:04 -0400
> Cc: [email-masked]
> 
> Eli Zaretskii <[email-masked]> wrote:
> 
> > It is not very clear to me what, specifically, did you try and what
> > did you expect to happen as result.  Would you mind showing a simple
> > recipe, starting from "emacs -Q", that should have displayed the
> > overlay arrow, but didn't?
> 
> Sorry for not being clear. Here is a recipe:
> 
> 1. Launch with "emacs -Q".
> 2. Switch to the scratch buffer.
> 3. Copy the following into the buffer and evaluate each expression:
> 
>    (setq-default left-fringe-width 0)
>    (setq-default left-margin-width 1)
>    (setq overlay-arrow-string
>          (propertize ">" 'display `((margin left-margin)
>                                     ,(propertize ">" 'face 'default))))
> 
> 4. Invoke "M-x occur", and enter "setq" when prompted for a regexp.
> 5. Switch to the Occur buffer and move between the matches by pressing "n"  
> and "p".
> 
>    Expected behavior: Indicator arrow ">" appears in the margin.
>    Current behavior: Indicator arrow ">" appears in the buffer.

Thanks, I understand now.  What you want to do is not currently
supported: we basically disregard the properties of
overlay-arrow-string and always display the string in the text-area.
The function get_overlay_arrow_glyph_row will need to be enhanced to
support displaying the overlay arrow in the margin via 'display'
properties.

> 6 (extra). Evaluate the following expression:
> 
>    (setq overlay-arrow-string (propertize ">" 'face 'shadow))
> 
> Unlike the display property, the face property does get applied and the  
> appearance of the arrow in the Occur buffer changes.

Yes, the above function explicitly accounts for the string's 'face'
property (and only that property), so it works.  But try setting the
face of the display string, like this:

   (setq overlay-arrow-string
         (propertize ">" 'display `((margin left-margin)
                                    ,(propertize ">" 'face 'shadow))))

and you will see that the face is ignored, since it's part of the
'display' property spec.