emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: w t <1218121@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Simple Literate Programming Example
Date: Thu, 27 May 2010 13:59:26 -1000	[thread overview]
Message-ID: <344BE44B-EFAD-49A8-A779-71C8412A711E@tsdye.com> (raw)
In-Reply-To: <AANLkTimLo1Sov2epY_dS4ppmMEscGjhClthkWpti8FId@mail.gmail.com>

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
>   # <<hello-world-prefix>>
>  echo "|                       hello world                         |"
>   # <<hello-world-postfix>>
> #+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]]
>
> # <<hello-world-prefix>>
> echo "|                       hello world                         |"
> # <<hello-world-postfix>>
> # 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

  reply	other threads:[~2010-05-27 23:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 23:43 Simple Literate Programming Example w t
2010-05-27 23:59 ` Thomas S. Dye [this message]
2010-05-28  3:32   ` w t

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=344BE44B-EFAD-49A8-A779-71C8412A711E@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=1218121@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).