emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Nicolas Girard <girard.nicolas@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [BUG] [Babel] Do not try to process inline source in macro templates
Date: Sun, 08 Sep 2013 04:55:29 -0600	[thread overview]
Message-ID: <87li37shge.fsf@gmail.com> (raw)
In-Reply-To: CANMKmeeuqrhcmZyYeOyHohy9D5zccdtTVzohj8dvkO1f1zQ2vQ@mail.gmail.com

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

Nicolas Girard <girard.nicolas@gmail.com> writes:

> 2013/9/2 Eric Schulte <schulte.eric@gmail.com> :
>>>
>>> I've just pushed up a fix for this issue which should now ignore inline
>>> source blocks on lines starting with "#+" during export.  I don't know
>>> if there is a better way than using a regex to detect such non-exporting
>>> lines but this appears to work.
>>>
>
> Thanks very much !
>

I've just pushed up a better (read: functional) solution suggested by
Nicolas Goaziou which uses org-element to determine when code blocks
should be executed.  This the current Org-mode the following example
file exports without error as expected.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: something.org --]
[-- Type: text/x-org, Size: 1294 bytes --]

#+Title: Example
#+Options: ^:{}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
natoque penatibus et magnis src_emacs-lisp{(current-time-string)} dis
parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae
dolor. Nullam tristique diam non turpis. Cras placerat accumsan
nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

# Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
# hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
# nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis
# natoque penatibus et magnis src_emacs-lisp{(error "don't evaluate me!!")}
# dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec
# vitae dolor. Nullam tristique diam non turpis. Cras placerat
# accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl.

- Lorem
- ipsum
- dolor src_emacs-lisp{(current-time-string)}
- sit
- amet

#+MACRO: name src_emacs-lisp{(error "don't evaluate me!!")}

#+begin_src emacs-lisp :exports results
  (current-time-string)
  ;; foo
  (current-time-string)
#+end_src

# #+begin_src emacs-lisp :export results
#   (error "don't evaluate me!!")
# #+end_src

[-- Attachment #3: Type: text/plain, Size: 72 bytes --]


Cheers,

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

      reply	other threads:[~2013-09-08 11:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23  7:55 [BUG] [Babel] Do not try to process inline source in macro templates Nicolas Girard
2013-09-02 16:35 ` Eric Schulte
2013-09-02 16:47   ` Carsten Dominik
2013-09-06 21:57     ` Nicolas Girard
2013-09-08 10:55       ` Eric Schulte [this message]

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=87li37shge.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=girard.nicolas@gmail.com \
    /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).