From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Tangling include files Date: Wed, 23 Nov 2016 21:22:08 -0800 Message-ID: References: <84bmx6le7z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9mUg-00027u-SM for emacs-orgmode@gnu.org; Thu, 24 Nov 2016 00:22:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9mUb-00083Z-R7 for emacs-orgmode@gnu.org; Thu, 24 Nov 2016 00:22:46 -0500 Received: from iport-acv1-out.ucsd.edu ([132.239.0.176]:6659) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9mUb-00082u-DZ for emacs-orgmode@gnu.org; Thu, 24 Nov 2016 00:22:41 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Harry Butterworth Cc: Marco Wahl , emacs-orgmode@gnu.org 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