From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [BUG] [Babel] Do not try to process inline source in macro templates Date: Sun, 08 Sep 2013 04:55:29 -0600 Message-ID: <87li37shge.fsf@gmail.com> References: <87fvtntc4f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIcmT-0006sj-R4 for emacs-orgmode@gnu.org; Sun, 08 Sep 2013 07:03:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIcmO-00086B-Kn for emacs-orgmode@gnu.org; Sun, 08 Sep 2013 07:03:49 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:59986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIcmO-000861-Cl for emacs-orgmode@gnu.org; Sun, 08 Sep 2013 07:03:44 -0400 Received: by mail-pa0-f49.google.com with SMTP id ld10so5089203pab.8 for ; Sun, 08 Sep 2013 04:03:43 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Girard Cc: emacs-orgmode --=-=-= Content-Type: text/plain Nicolas Girard writes: > 2013/9/2 Eric Schulte : >>> >>> 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. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=something.org #+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 --=-=-= Content-Type: text/plain Cheers, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D --=-=-=--