emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Samuel W. Flint" <swflint@flintfam.org>
Cc: Org-Mode <emacs-orgmode@gnu.org>
Subject: Re: Preventing noweb substitution during export
Date: Thu, 28 Dec 2017 12:42:51 +0100	[thread overview]
Message-ID: <874lobf58k.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87h8sbeqg6.fsf@curry.flintfam.org> (Samuel W. Flint's message of "Wed, 27 Dec 2017 16:50:01 -0600")

Hello,

swflint@flintfam.org (Samuel W. Flint) writes:

> Nicolas, my apologies for sending this twice.
>>>>>> Nicolas Goaziou writes:
>
>     NG> Hello, swflint@flintfam.org (Samuel W. Flint) writes:
>
>     >> I used to be able to prevent noweb substitution during export by
>     >> setting noweb to tangle, now it's only a yes/no option.  When was
>     >> this feature removed, and what can I do to get it back?
>
>     NG> I don't think that was intended. Would you have an ECM
>     NG> demonstrating the issue?
>
> It didn't get removed, though no-export is now the correct value.
> Neither, however, are currently documented in the manual.

Patches welcome! Org manual is now an Org file, it should be much more
pleasant to edit. :)

> And the following should demonstrate how they currently behave:
>
> #+BEGIN_EXAMPLE
> #+PROPERTY: :noweb tangle

This should be:

  #+property: header-args :noweb tangle

> #+name: a
> #+begin_src python
>   def foo():
>       print "foo"
> #+end_src
>
> #+name: b
> #+begin_src python
>
>
>   <<a>>
>
>   foo() #+end_src
>
> #+name: c
> #+begin_src python :tangle "test.py"
>
>   import bar
>   <<b>>
> #+end_src
> #+END_EXAMPLE
>
> The file 'test.py' will contain:
>
>     import bar
>     <<a>>
>
>     foo()
>
> If noweb is set to no-export, the <<a>> will be resolved.  However, with
> tangle, the block is included during export.

I cannot reproduce it. The following document:

--8<---------------cut here---------------start------------->8---
#+PROPERTY: header-args :noweb tangle

#+name: a
#+begin_src python
  def foo():
      print "foo"
#+end_src

#+name: b
#+begin_src python


  <<a>>

  foo()
 #+end_src

#+name: c
#+begin_src python :tangle "test.py"

  import bar
  <<b>>
#+end_src
--8<---------------cut here---------------end--------------->8---

becomes

--8<---------------cut here---------------start------------->8---
┌────
│ def foo():
│     print "foo"
└────

┌────
│ 
│ 
│ <<a>>
│ 
│ foo()
└────

┌────
│ 
│ import bar
│ <<b>>
└────
--8<---------------cut here---------------end--------------->8---

when exported to UTF-8.

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2017-12-28 11:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27 22:08 Preventing noweb substitution during export Samuel W. Flint
2017-12-27 22:29 ` Nicolas Goaziou
2017-12-27 22:50   ` Samuel W. Flint
2017-12-28 11:42     ` Nicolas Goaziou [this message]
2017-12-28 18:30       ` Thomas S. Dye
2017-12-28 21:50         ` Nicolas Goaziou

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=874lobf58k.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=swflint@flintfam.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).