emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: George Mauer <gmauer@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: call blocks as a function from inside elisp code
Date: Wed, 19 Jan 2022 16:43:44 +0000	[thread overview]
Message-ID: <87bl07oev3.fsf@ucl.ac.uk> (raw)
In-Reply-To: <CA+pajWKWT0s1FOZy3gG=WweYwRLTaPsxEKqVQXeZEYTbi4wuvg@mail.gmail.com> (George Mauer's message of "Wed, 19 Jan 2022 09:56:09 -0600")

On Wednesday, 19 Jan 2022 at 09:56, George Mauer wrote:
> So is there a way to do the equivalent of #+call:
> gim/get-python-program-info(filename="foo/bar/some_module.py") from
> *inside* an elisp code block? I am aware that I can call things via
> noweb, but I'm trying to see if I can avoid that for several other
> reasons

Two ways I can think of:

1. use the :post header argument to chain calls or
2. invoke (org-sbe "blockname") although I am not sure if you can pass
   variables.  org-sbe is a macro in ob-table.el.
   
There may be (very likely) a more general way to evaluate a src block
from with elisp.

HTH,
eric


-- 
: Eric S Fraga, with org release_9.5.2-306-g9623da in Emacs 29.0.50


  reply	other threads:[~2022-01-19 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 15:56 call blocks as a function from inside elisp code George Mauer
2022-01-19 16:43 ` Eric S Fraga [this message]
2022-01-19 20:00   ` Tom Gillespie

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=87bl07oev3.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=gmauer@gmail.com \
    /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).