From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Simple Literate Programming Example Date: Thu, 27 May 2010 13:59:26 -1000 Message-ID: <344BE44B-EFAD-49A8-A779-71C8412A711E@tsdye.com> References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=46435 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHmz5-0004yl-JD for emacs-orgmode@gnu.org; Thu, 27 May 2010 19:59:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHmz4-000546-63 for emacs-orgmode@gnu.org; Thu, 27 May 2010 19:59:31 -0400 Received: from oproxy1-pub.bluehost.com ([66.147.249.253]:40809 helo=outbound-mail-359.bluehost.com) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OHmz3-00053w-UH for emacs-orgmode@gnu.org; Thu, 27 May 2010 19:59:30 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: w t <1218121@gmail.com> Cc: emacs-orgmode@gnu.org On May 27, 2010, at 1:43 PM, w t wrote: > I put the "Simple Literate Programming Example" from the Org-Babel > Introduction in a file hello.org, namely, > > ==================hello.org=========================== > #+srcname: hello-world-prefix > #+begin_src sh :exports none > echo "/-----------------------------------------------------------\\" > #+end_src > > #+srcname: hello-world-postfix > #+begin_src sh :exports none > echo "\-----------------------------------------------------------/" > #+end_src > > #+srcname: hello-world > #+begin_src sh :tangle hello :exports none > # <> > echo "| hello world |" > # <> > #+end_src > ==================end=hello.org=========================== > > Then I do "M-x org-babel-tangle", and this generates the file hello: > > =================begin=hello============================ > #!/usr/bin/env sh > > # [[file:~/ORG/hello.org][hello-world]] > > # <> > echo "| hello world |" > # <> > # hello-world ends here > ==================end=hello============================= > > which does not seem to jive with the Introduction, which, among other > things, says the <<*>>'s should expand. I've seen other examples > where the #'s are removed from before the <<*>>'s, but this does not > seem to matter. Any ideas on what I'm missing? My .emacs file is > > ==============begin=.emacs============================= > (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) > (global-set-key "\C-cl" 'org-store-link) > (global-set-key "\C-ca" 'org-agenda) > (global-set-key "\C-cb" 'org-iswitchb) > > (setq load-path (cons "/tmp/org-mode/lisp" load-path)) > > (setq load-path (cons "/tmp/org-mode/contrib/lisp" load-path)) > (require 'org-babel-init) > (require 'org-babel-sh) > (org-babel-load-library-of-babel) > =============end=.emacs================================= > > and the "/tmp/org-mode/" is a Git directory from today. > Hi w t, Thanks for pointing this out. I believe you'll need to add the :noweb yes header argument to code blocks that include <<>> to be expanded. I'll update the example on Worg to reflect this newer feature of Org- babel. All the best, Tom