emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to call a source code block from another one


From: Eric S Fraga
Subject: Re: [O] How to call a source code block from another one
Date: Wed, 8 Mar 2017 11:46:35 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Wednesday,  8 Mar 2017 at 11:20, Marcin Borkowski wrote:
> Hi all,
>
> and sorry if this is trivial, but I didn't find it in the manual.
>
> Assume that I have a few source code blocks (in my case, in bash) and
> I want to call them in sequence.  Is it possible to write another,
> "master" source code block which would then call those previous blocks?

You could use noweb to include other code blocks in a master one.
You reference other src blocks using <<other-block-name>>.

e.g.
#+begin_src shell :noweb yes
<<block1>>
<<block2>>
#+end_src

where block1 and block2 are shell src blocks as well.

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.3-241-gc3d67b

Attachment: signature.asc
Description: PGP signature


reply via email to

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