Dear Nicolas and Chuck,
thanks for pointing me in the right direction. I never thought that
macros were actually just an export feature, and that noweb replacements
could be used as macros!
I am experiencing a little quirk though. Since I often edit this org
file under Windows, the tangled files have Windows new lines, and
(cygwin or any) bash doesn't like it. So I added a
org-babel-post-tangle-hook that set-buffer-file-coding-system to unix.
But the scripts that I tangle with a noweb ref end up with a weird ^M
after each end of line. It seems this happens after the post-tangle
hook. How could I take care of those ^M?
Thanks a lot,
Giacomo
Il 6/26/2017 7:06 PM, Charles C. Berry ha scritto:
On Mon, 26 Jun 2017, Nicolas Goaziou wrote:
Hello,
Giacomo M <jackja...@gmail.com> writes:
Dear all,
how can I add macro replacement support when a source block is being
tangled?
I don't think so. Macro replacement is an export feature.
If Giacomo's macros operate outside of src blocks, he could export
using `org-org-export-to-org', then tangle the resulting file.
Giacomo, if you want something to operate inside of src blocks you can
use noweb replacements that execute code as outlined in
(info "(org) Noweb reference syntax")
In a way these are like macros.
HTH,
Chuck