GNU bug report logs - #71030
Display property of overlay-arrow-string is not honored

Previous Next

Package: emacs;

Reported by: Emre Yolcu <mail <at> emreyolcu.com>

Date: Sat, 18 May 2024 09:51:02 UTC

Severity: normal

To reply to this bug, email your comments to 71030 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#71030; Package emacs. (Sat, 18 May 2024 09:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Emre Yolcu <mail <at> emreyolcu.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 18 May 2024 09:51:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Emre Yolcu <mail <at> emreyolcu.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Display property of overlay-arrow-string is not honored
Date: Sat, 18 May 2024 00:00:11 -0400
I have been trying to replace the use of fringes with margins in my 
configuration. (This is to work around the fact that fringe indicators 
look bad on high-DPI displays.) Using display properties, I was able to 
move almost all of the indicators I care about to the margins. However, 
as of Emacs 29.3, the display property of `overlay-arrow-string` is not 
honored. I have the following in my configuration:

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

The above setting fails to move the overlay arrow in, say, Occur buffers 
to the margin. On the other hand, the face property of 
`overlay-arrow-string` does get applied, so the following works as expected:

  (setq overlay-arrow-string (propertize ">" 'face 'shadow))

I am not sure what the intended behavior is supposed to be here, so this 
may be more of a feature request than a bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71030; Package emacs. (Sat, 18 May 2024 11:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 71030 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Emre Yolcu <mail <at> emreyolcu.com>
Cc: 71030 <at> debbugs.gnu.org
Subject: Re: bug#71030: Display property of overlay-arrow-string is not honored
Date: Sat, 18 May 2024 14:35:48 +0300
> Date: Sat, 18 May 2024 00:00:11 -0400
> From: Emre Yolcu <mail <at> emreyolcu.com>
> 
> I have been trying to replace the use of fringes with margins in my 
> configuration. (This is to work around the fact that fringe indicators 
> look bad on high-DPI displays.) Using display properties, I was able to 
> move almost all of the indicators I care about to the margins. However, 
> as of Emacs 29.3, the display property of `overlay-arrow-string` is not 
> honored. I have the following in my configuration:
> 
>    (setq overlay-arrow-string
>          (propertize ">" 'display `((margin left-margin)
>                                     ,(propertize ">" 'face 'default))))
> 
> The above setting fails to move the overlay arrow in, say, Occur buffers 
> to the margin. On the other hand, the face property of 
> `overlay-arrow-string` does get applied, so the following works as expected:
> 
>    (setq overlay-arrow-string (propertize ">" 'face 'shadow))
> 
> I am not sure what the intended behavior is supposed to be here, so this 
> may be more of a feature request than a bug report.

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?  Then I could look into the relevant code
and see if this is supported and/or whether or how we could make it
work.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71030; Package emacs. (Sun, 19 May 2024 08:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 71030 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Emre Yolcu <mail <at> emreyolcu.com>
Cc: 71030 <at> debbugs.gnu.org
Subject: Re: bug#71030: Display property of overlay-arrow-string is not honored
Date: Sun, 19 May 2024 11:39:36 +0300
> From: Emre Yolcu <mail <at> emreyolcu.com>
> Date: Sat, 18 May 2024 13:33:04 -0400
> Cc: 71030 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71030; Package emacs. (Sun, 19 May 2024 12:28:05 GMT) Full text and rfc822 format available.

Message #14 received at 71030 <at> debbugs.gnu.org (full text, mbox):

From: Emre Yolcu <mail <at> emreyolcu.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71030 <at> debbugs.gnu.org
Subject: Re: bug#71030: Display property of overlay-arrow-string is not honored
Date: Sat, 18 May 2024 13:33:04 -0400
Eli Zaretskii <eliz <at> gnu.org> 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.

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.





This bug report was last modified 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.