emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: asenal <asenalhere@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: how to quote "#+end_src" string in a Babel block?
Date: Wed, 24 Jul 2013 09:24:52 +0200	[thread overview]
Message-ID: <8738r4773v.fsf@gmail.com> (raw)
In-Reply-To: <65A347E6-F361-4410-93B6-CEA910195E7E@gmail.com> (asenal's message of "Wed, 24 Jul 2013 13:39:13 +0800")

Hello,

asenal <asenalhere@gmail.com> writes:

> My problem is How can I safely quote "#+XXX" inside a Babel-block?
> I found org-mode mismatch the outter "#+begin_src"  with the first "#+end_src" inside the block hence gives me a wrong parse.
>
> Here's an example:
> #+headers: :var varlist=top_iv
> #+begin_src python :return iv_template(varlist)
>   def iv_template(varlist,db,table):
>       for var in varlist:
>           babel_template='''
> 	  #+name: var
>           #+begin_src sqlite :db mydb
>             SELECT colName,cnt,suc,fal,iv FROM mytable WHERE colName == %s';
>           #+end_src   # org mode stop here!
>           ''' % (var,var)
>
>           print babel_template
> #+end_src

Within a source block, you must prepend a comma to every line starting
with "*" or "#+". C-c ' will do that for you.


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2013-07-24  7:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24  5:39 how to quote "#+end_src" string in a Babel block? asenal
2013-07-24  6:11 ` Thorsten Jolitz
2013-07-24  7:24 ` Nicolas Goaziou [this message]
2013-07-24 22:32 ` Eric Schulte
2013-08-15 11:38   ` asenal

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=8738r4773v.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=asenalhere@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).