Fork me on GitHub
#emacs
<
2022-08-01
>
Benjamin11:08:47

jo in org ins't there a way to inline elisp, also inside source blocks? My goal is to achieve something like this:

#+begin_src elisp
  (defvar my-file-name "resources/foo.sql")
#+end_src

#+begin_src sql :tangle <my-file-name>
  select
#+end_src

#+begin_src clojure
  (jdbc/execute.... <my-file-name>)
#+end_src
so something like an ad hoc substitution definition or something. Where I say subst with this string and further up I define the string

ag17:08:53

What's your question? I read twice, still can't decipher it. Are you trying to share results of evaluation of one source block with another?

Benjamin17:08:09

that would be interesting, too ye.

Benjamin17:08:29

initially I thought there must be a way to basically refer from any text in org to another block, like expanding the text. Or to basically expand elisp into text would also be interesting

ag17:08:26

IIRC, you can't refer to another source block verbatim. But I think I successfully fed an example block to a source block once. Using the same technique described by Kitchin.

👀 1
Drew Verlee21:08:06

i thought this was the main emacs thread, ignore those messages 🙂