Ihor Radchenko <yanta...@posteo.net> writes:

> [...] and :file-ext is not given?  But how will you know the desired
> extension?

Oh, I missed that.  My local hack assumes `.svg', but that is not enough
for the general use case.

Perhaps, we could save as `$BASENAME.out', detect the image format, and
then rename to `$BASENAME.svg', for example.  If the file is not an
image, we leave it as `.out'.

We can detect the image type with `image-type':

  (image-type "...-59b9176e65c9.svg") => svg

If the above is sufficient, the problem reduces to:

  how to compute the `$BASENAME'?

[`org-babel-tangle-comment-format-beg' does something similar.]

Rudy
-- 
"One can begin to reason only when a clear picture has been formed in
the imagination."
--- Walter Warwick Sawyer, Mathematician's Delight, 1943

Rudolf Adamkovič <rud...@adamkovic.org> [he/him]
http://adamkovic.org

Reply via email to