[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to get the content of a code block by its name?
From: |
Rodrigo Morales |
Subject: |
How to get the content of a code block by its name? |
Date: |
Thu, 11 Feb 2021 20:54:12 -0500 |
User-agent: |
mu4e 1.4.14; emacs 27.1 |
* The question
Let's suppose I have this simple code block in a buffer (let's say
=A=)
#+NAME: five-numbers
#+begin_src bash
echo foo
seq 1 5
echo bar
#+end_src
How can I get the content of the code block with name =five-numbers=
as an string from any point in buffer =A=?
* Additional information
I'm asking this because I would like to have a function which would
help me insert a code block in the =:prologue= header argument of
another code block.
#+begin_src bash :prologue (get-code-block-as-string "five-numbers")
echo a
#+end_src
--
Greetings,
Rodrigo Morales.
IRC: rdrg109 (freenode)
- How to get the content of a code block by its name?,
Rodrigo Morales <=