[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] «Macro» expansion in source blocks; code-sharing between blocks
From: |
Eric S Fraga |
Subject: |
Re: [O] «Macro» expansion in source blocks; code-sharing between blocks |
Date: |
Thu, 18 Sep 2014 15:01:37 +0100 |
On Thursday, 18 Sep 2014 at 13:26, Tobias Getzner wrote:
> On Thu, 18 Sep 2014 13:17:14 +0000, Tobias Getzner wrote:
>
>> Are there any convenient inline-expansion methods I might have
>> overlooked?
>
> To illustrate, I was wondering if any of the following is feasible
> somehow:
Yes, and you almost got it right with your syntactic expansion:
#+begin_src org
,* Syntactic expansion
,#+name: setup_fu
,#+begin_src sh :noweb yes
echo 2
,#+end_src
,#+begin_src sh :results raw :noweb yes
echo 1
<<setup_fu>>
echo 3
,#+end_src
,#+results:
1
2
3
#+end_src
Org src blocks can reference other src blocks. Note the ":noweb yes"
option and the use of <<...>>.
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-366-gb2fca7
signature.asc
Description: PGP signature
- [O] «Macro» expansion in source blocks; code-sharing between blocks, Tobias Getzner, 2014/09/18
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Tobias Getzner, 2014/09/18
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks,
Eric S Fraga <=
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Tobias Getzner, 2014/09/18
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Andreas Kiermeier, 2014/09/18
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Eric S Fraga, 2014/09/19
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Charles Berry, 2014/09/19
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Andreas Kiermeier, 2014/09/19
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Rainer M Krug, 2014/09/19
- Re: [O] «Macro» expansion in source blocks; code-sharing between blocks, Andreas Kiermeier, 2014/09/19
- [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks, Rainer M Krug, 2014/09/19
- Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks, Andreas Kiermeier, 2014/09/20
- Re: [O] header arguments, inheritance, and noweb expansion Was: «Macro» expansion in source blocks; code-sharing between blocks, Charles Berry, 2014/09/20