unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71030: Display property of overlay-arrow-string is not honored
@ 2024-05-18  4:00 Emre Yolcu
  2024-05-18 11:35 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Emre Yolcu @ 2024-05-18  4:00 UTC (permalink / raw)
  To: 71030

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71030: Display property of overlay-arrow-string is not honored
  2024-05-18  4:00 bug#71030: Display property of overlay-arrow-string is not honored Emre Yolcu
@ 2024-05-18 11:35 ` Eli Zaretskii
  2024-05-18 17:33   ` Emre Yolcu
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-18 11:35 UTC (permalink / raw)
  To: Emre Yolcu; +Cc: 71030

> Date: Sat, 18 May 2024 00:00:11 -0400
> From: Emre Yolcu <mail@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71030: Display property of overlay-arrow-string is not honored
  2024-05-18 11:35 ` Eli Zaretskii
@ 2024-05-18 17:33   ` Emre Yolcu
  2024-05-19  8:39     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Emre Yolcu @ 2024-05-18 17:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 71030

Eli Zaretskii <eliz@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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#71030: Display property of overlay-arrow-string is not honored
  2024-05-18 17:33   ` Emre Yolcu
@ 2024-05-19  8:39     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-19  8:39 UTC (permalink / raw)
  To: Emre Yolcu; +Cc: 71030

> From: Emre Yolcu <mail@emreyolcu.com>
> Date: Sat, 18 May 2024 13:33:04 -0400
> Cc: 71030@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-19  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-18  4:00 bug#71030: Display property of overlay-arrow-string is not honored Emre Yolcu
2024-05-18 11:35 ` Eli Zaretskii
2024-05-18 17:33   ` Emre Yolcu
2024-05-19  8:39     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).