emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yu <yu_icq@gmx.at>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: org-babel: Evaluating code blocks with noweb references but ":noweb tangle".
Date: Mon, 6 Feb 2012 14:15:25 +0100	[thread overview]
Message-ID: <CANtbJLFWYwGoTTMw3DumN2sW4HXfzUUhM_1UsWE=wx8u+kyc4A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 569 bytes --]

Hello!

I sometimes have scenarios where I want to use the "noweb" feature in
interactive evaluation, but want the code to stay in its unexpanded
form on export. Currently I think, there is no way to achieve this and
I use tangling into a helper module file as a workaround (which is
reasonable for python anyway though).

Thus I'd appreciate a new option for the :noweb header argument; Sort
of an "in between" of ":noweb tangle" and ":noweb yes" ("expand noweb
references always except for exporting").

kind regards, Yu

PS: I have added example files to the email.

[-- Attachment #2: test.html --]
[-- Type: text/html, Size: 4440 bytes --]

[-- Attachment #3: test.org --]
[-- Type: application/octet-stream, Size: 1395 bytes --]

#+TITLE:     Testing :noweb
#+AUTHOR:    yu
#+EMAIL:     
#+DATE:      2012-02-06 Mon
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:


# -*- org-confirm-babel-evaluate: nil -*-

* The Task Definition

# ------------------------------------------------------------------ #
#+begin_src python :noweb-ref task1 :results output
  print "Hello World"
#+end_src
#+results:
: Hallo Welt
# ------------------------------------------------------------------ #

* Trying to Evaluate for :noweb tangle results in an error message. 

# ------------------------------------------------------------------ #
#+begin_src python :noweb tangle :results output
  <<task1>>
#+end_src
#+results:
# ------------------------------------------------------------------ #

* With :noweb yes it works fine, but the code is exported in expanded form. 

# ------------------------------------------------------------------ #
#+begin_src python :noweb yes :results output 
  <<task1>>
#+end_src
#+results:
: Hallo Welt
# ------------------------------------------------------------------ #


             reply	other threads:[~2012-02-06 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 13:15 Yu [this message]
2012-02-06 13:31 ` org-babel: Evaluating code blocks with noweb references but ":noweb tangle" Sebastien Vauban

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='CANtbJLFWYwGoTTMw3DumN2sW4HXfzUUhM_1UsWE=wx8u+kyc4A@mail.gmail.com' \
    --to=yu_icq@gmx.at \
    --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).