emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR] Add support for racket images in org-babel


From: Ihor Radchenko
Subject: Re: [FR] Add support for racket images in org-babel
Date: Thu, 29 Dec 2022 14:02:47 +0000

dalanicolai <dalanicolai@gmail.com> writes:

>> You likely need to extend `org-babel-scheme--table-or-string' to
>> understand Image: type.
>>
>
> It looks to me that when `org-babel-execute:scheme` gets executed, then the
> result will not get inserted as a link, as that would require the results
> type 'file', right?
> From the manual <https://orgmode.org/manual/Results-of-Evaluation.html>, it
> seems to me that using the 'file' type is required to get the result
> inserted as a link.
>
> However, I can not see how the code does the following as explained in the
> manual.
>
> The manual <https://orgmode.org/manual/Results-of-Evaluation.html> states
> (under Type/file):
>
>> If ‘file’ header argument is missing, Org generates the base name of the
>> output file from the name of the code block, and its extension from the ‘
>> file-ext’ header argument. In that case, both the name and the extension
>> are mandatory.
>>
> suggesting that a file gets written also when there is no :file header
> argument.

> But from the `and` condition here
> <https://github.com/bzg/org-mode/blob/bd468136dd1a2172302b3ec980c5e6b6e327d683/lisp/ob-core.el#L820>
> in `org-babel-execute-src-block`, it looks to me that a file is only
> written when a :file argument is provided (via the `with-temp-file` that
> follows within the 'when file ...').
> Anyway, this I only found when trying to find out how the result gets
> formatted as a link.

One can use :results file link without :file header argument.

#+begin_src bash :results file link
echo -n "~/Downloads/wallpaper.png"
#+end_src

#+RESULTS[9c92ca9d7a3cce34ddcc4714ea917225be60e080]:
[[file:/home/yantar92/Downloads/wallpaper.png]]

I now clarified this on main
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b2adb68af

Hope it clarifies how to achieve what you want without advice.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]