[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Tangling include files
From: |
Robert Klein |
Subject: |
Re: [O] Tangling include files |
Date: |
Thu, 24 Nov 2016 10:00:04 +0100 |
On Wed, 23 Nov 2016 21:22:08 -0800
"Charles C. Berry" <address@hidden> wrote:
> On Thu, 24 Nov 2016, Harry Butterworth wrote:
>
> > I tried org-org-export-to-org which puts everything into a single
> > document but it strips the :tangle parameters out so a subsequent
> > tangle doesn't generate any source code.
> >
>
> You might try this. Put this at the *top* of your file:
>
> --8<---------------cut here---------------start------------->8---
>
> #+PROPERTY: header-args :eval never-export
>
> #+NAME: tangle file
> #+BEGIN_SRC emacs-lisp :eval yes :exports results
> (org-babel-tangle)
> #+END_SRC
>
> --8<---------------cut here---------------start------------->8---
>
> Type C-c C-c on the property line to refresh it.
>
> Now export. Type 'y' in reply to the query to eval the `tangle file'
> src block and again to the `discard edits' query.
>
> Even exporting to a buffer should be fine. You do not really want the
> exported document, you just want to force the inclusions to take
> place and then run that src block.
>
> This should work, because `org-export-as' will expand all the
> include's before running babel. If the above block runs before any
> others, then the :tangle headers will still be in place.
>
> In fact you could create a separate file, place all the above in it
> and add one line at the bottom to include the top level org file you
> want to tangle from. Then export that.
>
> HTH,
>
> Chuck
>
A line
#+Property: tangle yes
in your org document is sufficient to get it tangled (in org 8.3.6).
I'm currently using the attached script for tangling configuration
files and scripts from the command line. Please note, it expects
the Emacs initialization file to be ~/.emacs ....
Best regards
Robert
tangle.el
Description: Text Data