emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Replace macros on tangle


From: Giacomo M
Subject: Re: [O] Replace macros on tangle
Date: Tue, 27 Jun 2017 12:14:42 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

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 <address@hidden> 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




reply via email to

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