GNU bug report logs -
#75776
30.0.50; Displaying image slice in the right margin
Previous Next
Reported by: Evgeny Zajcev <lg.zevlg <at> gmail.com>
Date: Thu, 23 Jan 2025 07:11:01 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
чт, 23 янв. 2025 г. в 13:02, Eli Zaretskii <eliz <at> gnu.org>:
> > From: Evgeny Zajcev <lg.zevlg <at> gmail.com>
> > Date: Thu, 23 Jan 2025 10:10:05 +0300
> >
> > I'm having problem displaying an image slice in the right margin. To
> > reproduce this, download
> > https://www.gnu.org/software/emacs/images/emacs.png to your ~/Downloads
> > folder. Activate right margin with M-x visual-fill-column RET. And
> consider three pieces of code:
> >
> > 1. (insert
> > (propertize "E" 'display `((slice 0 0 1.0 20) ,(create-image
> > "~/Downloads/emacs.png" nil nil :scale 1.0))))
> >
> > Displays image slice in the buffer as expected.
> >
> > 2. (insert
> > (propertize "E" 'display `((margin right-margin) ,(create-image
> > "~/Downloads/emacs.png" nil nil :scale 1.0))))
> >
> > Displays image in the right margin as expected.
> >
> > 3. (insert
> > (propertize "E" 'display `((margin right-margin)
> > ((slice 0 0 1.0 20)
> > ,(create-image "~/Downloads/emacs.png" nil nil :scale 1.0)))))
> >
> > Displays "E"
> >
> > Documentation say that ((margin right-margin) SPEC) can be used to
> > display image in the right margin, and SPEC is totally valid in the
> > 3. because 2. works.
> >
> > Is this a bug?
>
> You need to construct the display property in a different order:
>
> (insert
> (propertize "E" 'display
> `((slice 0 0 1.0 20)
> ((margin left-margin)
> ,(create-image "~/Downloads/emacs.png"
> nil nil :scale 1.0)))))
This works perfectly! Thanks for your reply and comprehensive explanation
--
lg
[Message part 2 (text/html, inline)]
This bug report was last modified 171 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.