emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: dalanicolai <dalanicolai@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [FR] Add support for racket images in org-babel
Date: Thu, 29 Dec 2022 14:02:47 +0000	[thread overview]
Message-ID: <87tu1etiig.fsf@localhost> (raw)
In-Reply-To: <CACJP=3=HrzaB+b2bTk2=-hrcv0STx41eFjedgtp=qXvGjVJQWA@mail.gmail.com>

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	other threads:[~2022-12-29 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  0:11 [FR] Add support for racket images in org-babel dalanicolai
2022-12-18 12:38 ` Ihor Radchenko
2022-12-21 12:34   ` dalanicolai
2022-12-29 14:02     ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu1etiig.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=dalanicolai@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).