From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: Re: org-babel tangling + ascii export Date: Mon, 26 Mar 2012 11:57:31 -0400 Message-ID: References: <87ehsfr2mi.fsf@gmx.com> <874ntb4ifg.fsf@gmx.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080105030100050409090103" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCCIq-0001ya-MC for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 11:57:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCCIk-0006Ud-6Y for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 11:57:52 -0400 Received: from plane.gmane.org ([80.91.229.3]:38825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCCIj-0006Tz-Sw for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 11:57:46 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SCCIh-0006B2-CL for emacs-orgmode@gnu.org; Mon, 26 Mar 2012 17:57:43 +0200 Received: from dhcp-140-247-108-225.fas.harvard.edu ([140.247.108.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Mar 2012 17:57:43 +0200 Received: from ilya_shl by dhcp-140-247-108-225.fas.harvard.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Mar 2012 17:57:43 +0200 In-Reply-To: <874ntb4ifg.fsf@gmx.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------080105030100050409090103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >>> The text is picked from the leading context of the tangled code and is >> limited by the nearest headline or source block as the case may be. >> >> I want all text from the Org file included, not just "leading context up to >> nearest headline". > > The above text means "per code block", so the entire file is exported. > >> I also want the hierarchical structure of the included text preserved, >> as done by ASCII export. > > Please try to tangle the attached file, I believe it is what you want. Not quite: in the file you sent, "This is a the top of an Org-mode file." is not included in the tangled file. Also, in the slightly expanded version of your example I'm attaching, the high-level comments at the top of the file are not included. Also, when I nest another headline inside "Headline 1", only the content of that headline -- not of Headline 1 -- is included. I'm attaching the current result of tangling, as well as what I ideally want. example-idea.el was produced by doing an ASCII export, then commenting everything in it except the code blocks. The resulting file is both fully executable and contains everything from the original org file, so it stands on its own and is independent of Emacs/Org. Thanks for help, ilya --------------080105030100050409090103 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="something.org" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="something.org" #+Property: comments both #+Property: tangle example.el This is a the top of an Org-mode file. * This is some high-level documentation This file does X and Y. *** Section A High-level documentation for functionality A. *** Section B High-level documentation for functionality B. * Headline 1 This is content inside of a headline. *** And this is the info about the block. | 1 | | 2 | | 3 | | 4 | #+begin_src emacs-lisp (message "code block 1") #+end_src * Headline 2 This is content inside of a secondary headline. #+begin_src emacs-lisp (message "code block 1") #+end_src --------------080105030100050409090103 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="example.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="example.el" ;; And this is the info about the block. ;; | 1 | ;; | 2 | ;; | 3 | ;; | 4 | ;; [[git:/cvar/selection/sweep2/nsvn/Tools/org/devel2/org-mode/something.org::fix-colview-todo-by-itself@{2012-03-26}][And-this-is-the-info-about-the-block\.:1]] (message "code block 1") ;; And-this-is-the-info-about-the-block\.:1 ends here ;; Headline 2 ;; This is content inside of a secondary headline. ;; [[git:/cvar/selection/sweep2/nsvn/Tools/org/devel2/org-mode/something.org::fix-colview-todo-by-itself@{2012-03-26}][Headline-2:1]] (message "code block 1") ;; Headline-2:1 ends here --------------080105030100050409090103 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="example-ideal.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="example-ideal.el" ;; This is a the top of an Org-mode file. ;; ====================================== ;; ;; Author: Ilya Shlyakhter ;; Date: 2012-03-26 11:50:40 EDT ;; ;; ;; ;; Table of Contents ;; ================= ;; 1 This is some high-level documentation ;; 1.1 Section A ;; 1.2 Section B ;; 2 Headline 1 ;; 2.1 And this is the info about the block. ;; 3 Headline 2 ;; ;; ;; 1 This is some high-level documentation ;; ---------------------------------------- ;; ;; This file does X and Y. ;; ;; 1.1 Section A ;; ============== ;; ;; High-level documentation for functionality A. ;; ;; 1.2 Section B ;; ============== ;; ;; High-level documentation for functionality B. ;; ;; 2 Headline 1 ;; ------------- ;; ;; This is content inside of a headline. ;; ;; 2.1 And this is the info about the block. ;; ========================================== ;; ;; 1 ;; 2 ;; 3 ;; 4 (message "code block 1") ;; 3 Headline 2 ;; ------------- ;; This is content inside of a secondary headline. (message "code block 1") --------------080105030100050409090103--