bug#42521: 28.0.50; Can't include an image in a display string

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#42521: 28.0.50; Can't include an image in a display string

Eli Zaretskii
> Cc: [hidden email]
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 25 Jul 2020 13:26:19 +0300
>
> Like supporting image spec placed on 'before-string' instead of 'display':
>
> (progn
>    (erase-buffer)
>    (insert " ")
>    (setq o (make-overlay (point-min) (point)))
>    (overlay-put o 'display
>                 (propertize " text after image"
>                             'before-string
>                             (create-image "splash.svg" nil nil
>                                           :max-height
>                                           (default-font-height)))))
>
> If this worked, I would actually prefer it.

This puts a 'before-string' property on a display string.  But
'before-string' is an overlay property, not a text property, so it
cannot be put on a string, only on buffer text.



Reply | Threaded
Open this post in threaded view
|

bug#42521: 28.0.50; Can't include an image in a display string

Dmitry Gutov
On 25.07.2020 13:56, Eli Zaretskii wrote:
> This puts a 'before-string' property on a display string.  But
> 'before-string' is an overlay property, not a text property, so it
> cannot be put on a string, only on buffer text.

Ah, yes. Thank you for the reminder.