[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 29.3: enriched text SVG images
From: |
Eli Zaretskii |
Subject: |
Re: 29.3: enriched text SVG images |
Date: |
Sat, 29 Jun 2024 09:57:17 +0300 |
> From: Christopher Howard <christopher@librehacker.com>
> Date: Fri, 28 Jun 2024 11:10:03 -0800
>
> Hi, I wanted to submit this as a bug, but lately I keep getting in trouble
> for submitting bugs and then realizing I read the documentation wrong...
That shouldn't stop you from reporting bugs. Closing a bug that is
not a bug is easy, and there's no shame in reporting a bug because you
didn't know something. So please keep reporting bugs whenever you see
something you think might be a bug.
> When I read the documentation for enriched-mode, I get the impression it is
> possible to save images embedded in a text/enriched document. And indeed, I
> can save an SVG image in the document. But for some reason when I open the
> document back up, the image is not displayed correctly. I tested that this
> behaves the same if I use "emacs -q".
> M-x find-file ~/Scratch/enriched-test.txt
> M-x enriched-mode
> M-x eval-express (setq svg (svg-create 400 400))
> M-x eval-express (svg-circle svg 200 200 50)
> M-x eval-express (insert-image (svg-image (svg-circle (svg-create 400 400
> :stroke "orange" :stroke-width 5) 200 200 50)))
> [image is visible as expected]
I tried to reproduce this, but I see only an empty square at this
point. Are you sure you have all the steps of the recipe accurate and
without mistakes? (It definitely lacks (require 'svg) at least.)
When the image is displayed correctly, if you go to the image and type
"M-x describe-text-properties RET", what does Emacs show in a buffer
it pops up?
> M-x eval-express (setq enriched-allow-eval-in-display-props t)
> [kill and reopen the buffer]
>
> Instead of the image, I see only a small empty square. If I
> find-file-literally, I see that the image data is saved:
>
> ```
> Content-Type: text/enriched
> Text-Width: 70
>
> <x-display><param>(image :type svg :data "<svg width=\"400\" height=\"400\"
> version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"
> xmlns:xlink=\"http://www.w3.org/1999/xlink\"> <circle cx=\"200\" cy=\"200\"
> r=\"50\"></circle></svg>" :scale 1.7009009009009008 :transform-smoothing
> t)</param>circle</x-display>
> ```
What do you see in *Messages* after you visit the saved file as
described above?