From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: [Babel] org-babel-execute-buffer gives different results than org-babel-exp-non-block-elements Date: Thu, 22 Aug 2013 20:23:15 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=089e0117691563900704e48d638e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCZXm-0001in-Eu for emacs-orgmode@gnu.org; Thu, 22 Aug 2013 14:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCZXl-0005NP-JH for emacs-orgmode@gnu.org; Thu, 22 Aug 2013 14:23:38 -0400 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:34892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCZXl-0005NH-8Y for emacs-orgmode@gnu.org; Thu, 22 Aug 2013 14:23:37 -0400 Received: by mail-la0-f45.google.com with SMTP id eh20so1739287lab.18 for ; Thu, 22 Aug 2013 11:23:35 -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: emacs-orgmode --089e0117691563900704e48d638e Content-Type: text/plain; charset=ISO-8859-1 Hi all, One thing I've been missing for long within org-mode is transclusion ; so eventually I came up with some preliminary code which seems promising regarding what I have in mind. Now, I wish I would dedicate a full thread on this subject once my code works in a predictable way ; but for now I'm experiencing something annoying: while evaluating my test document using =(org-babel-execute-buffer)=, or typing =C-c C-c= over the inline Babel non block elements works fine, exporting the same document using =C-c C-e t U= doesn't give the same results. Looking into Babel source, I came up with the following conclusion: - =(org-babel-execute-buffer)= produces the results I expect ; - the exporter calls =org-export-execute-babel-code=, which eventually triggers =(org-babel-exp-non-block-elements (point-min) (point-max))=. And this latter function doesn't lead to the same results as =(org-babel-execute-buffer)= Could anyone give me a hand on this ? Attached is my test document, containing both my preliminary code for transclusion, and some tests at the bottom. Thanks very much in advance, cheers, Nicolas --089e0117691563900704e48d638e Content-Type: application/octet-stream; name="transclusion.org" Content-Disposition: attachment; filename="transclusion.org" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkoash880 IytBVVRIT1I6IE5pY29sYXMgR2lyYXJkIDxnaXJhcmQubmljb2xhc0BnbWFpbC5jb20+CgoqIENv ZGUgdG8gZXZhbHVhdGUKRXZhbHVhdGUgd2l0aDogKG9yZy1iYWJlbC1sb2FkLWZpbGUgYnVmZmVy LWZpbGUtbmFtZSkKCioqIG5nL2RlY29kZS1saW5rCiMrQkVHSU5fU1JDIGVtYWNzLWxpc3AKICAo ZGVmdW4gbmcvZGVjb2RlLWxpbmsgKHMpCiAgICAiW1t4XVt5XV0gLT4gKHggLiB5KSIKICAgIChs ZXQgKGRlc2MgbGluaykKICAgICAgKHdoZW4KICAgICAgICAgIChzdHJpbmctbWF0Y2ggb3JnLWJy YWNrZXQtbGluay1yZWdleHAgcykKICAgICAgICAoc2V0cSBkZXNjIChpZiAobWF0Y2gtZW5kIDMp IChvcmctbWF0Y2gtc3RyaW5nLW5vLXByb3BlcnRpZXMgMyBzKSkpCiAgICAgICAgKHNldHEgbGlu ayAob3JnLWxpbmstdW5lc2NhcGUKICAgICAgICAgICAgICAgICAgICAob3JnLW1hdGNoLXN0cmlu Zy1uby1wcm9wZXJ0aWVzIDEgcykpKQogICAgICAgIChjb25zIGxpbmsgZGVzYykpKSkKIytFTkRf U1JDCioqIG5nL2dldC1zeW1saW5rLWlkCiMrQkVHSU5fU1JDIGVtYWNzLWxpc3AKICAoZGVmdW4g bmcvZ2V0LXN5bWxpbmstaWQgKHMpCiAgICAiW1tpZDo4ODgtNzddW2ZmZmZdXSAtPiA4ODgtNzci CiAgICAod2hlbiAKICAgICAgKGFuZCAoc3RyaW5nLW1hdGNoIG9yZy1icmFja2V0LWxpbmstcmVn ZXhwIHMpCiAgICAgICAgICAgKHNldHEgcyAobWF0Y2gtc3RyaW5nIDEgcykpCiAgICAgICAgICAg KHN0cmluZy1tYXRjaCAiXmlkXFw6XFwoW15dW10rXFwpIiBzKSkKICAgICAgKG1hdGNoLXN0cmlu ZyAxIHMpCiAgICAgICkpCiMrRU5EX1NSQwoqKiBuZy9kZWxldGUtY3VycmVudC1saW5lCiMrQkVH SU5fU1JDIGVtYWNzLWxpc3AKICAoZGVmdW4gbmcvZGVsZXRlLWN1cnJlbnQtbGluZSAoKQogICAg KGxldCAoKGIgKHBvaW50LWF0LWJvbCkpCiAgICAgICAgICAoZSAoKyAxIChwb2ludC1hdC1lb2wp KSkpCiAgICAgIChkZWxldGUtcmVnaW9uIGIgZSkpKQojK0VORF9TUkMKKiogbmcvb3JnLXRjCiMr QkVHSU5fU1JDIGVtYWNzLWxpc3AKICAoZGVmdW4gbmcvb3JnLXRjIChzKQogICAgKGxldCogKChh dC1oZWFkaW5nLXAgKG9yZy1hdC1oZWFkaW5nLXApKQogICAgICAgICAgIChkZWMgKG5nL2RlY29k ZS1saW5rIHMpKQogICAgICAgICAgIChsaW5rIChmaXJzdCBkZWMpKQogICAgICAgICAgIChuZXct dGl0bGUgKHJlc3QgZGVjKSkKICAgICAgICAgICAoaWQgKG9yIChuZy9nZXQtc3ltbGluay1pZCBz KSBsaW5rKSkKICAgICAgICAgICAobHYtcHJvcCAiX0NVUlJFTlRfTEVWRUxfIikKICAgICAgICAg ICAoY3Vyci1sdiAob3IgKG9yZy1jdXJyZW50LWxldmVsKSAwKSkKICAgICAgICAgICA7KG9sZC1s diAoc3RyaW5nLXRvLW51bWJlciAKICAgICAgICAgICA7ICAgICAgICAgKG9yIChvcmctZW50cnkt Z2V0LXdpdGgtaW5oZXJpdGFuY2UgbHYtcHJvcCkgY3Vyci1sdikpKQogICAgICAgICAgICkKICAg ICAgKHVubGVzcyBpZAogICAgICAgIChlcnJvciAoZm9ybWF0ICJObyBpZCBmb3VuZDogJXMiIHMp KSkKICAgICAgKG5nL2RlbGV0ZS1jdXJyZW50LWxpbmUpCiAgICAgIChzYXZlLWV4Y3Vyc2lvbgog ICAgICAgIChzYXZlLXdpbmRvdy1leGN1cnNpb24KICAgICAgICAgIChvcmctaWQtb3BlbiBpZCkK ICAgICAgICAgIChvcmctY29weS1zdWJ0cmVlKSkpCiAgICAgIChtZXNzYWdlIChmb3JtYXQgIkxl dmVsczogJXMgLyAlcyIgY3Vyci1sdiBvbGQtbHYpKQogICAgICAod2l0aC10ZW1wLWJ1ZmZlcgog ICAgICAgIChvcmctbW9kZSkKICAgICAgICAob3JnLXBhc3RlLXN1YnRyZWUgY3Vyci1sdiBuaWwg bmlsKQogICAgICAgIChvcmctZGVsZXRlLXByb3BlcnR5ICJJRCIpIDsgcHJldmVudHMgSUQgZHVw bGljYXRpb24gaWYgYW4gZW50cnkgZ2V0cyBwYXN0ZWQgc2V2ZXJhbCB0aW1lcwogICAgICAgIChv cmctc2V0LXByb3BlcnR5IGx2LXByb3AgKGZvcm1hdCAiJWQiIG9sZC1sdikpCiAgICAgICAgKG9y Zy1iYWNrLXRvLWhlYWRpbmcpCiAgICAgICAgKGlmIGF0LWhlYWRpbmctcAogICAgICAgICAgKHBy b2duCiAgICAgICAgICAgIDsgUmVuYW1lIHRoZSBoZWFkaW5nCiAgICAgICAgICAgIChyZXBsYWNl LXN0cmluZyAobmcvb3JnLWdldC1lbnRyeS10aXRsZSkgbmV3LXRpdGxlIG5pbCAocG9pbnQpIChw b2ludC1hdC1lb2wpKQogICAgICAgICAgOyBib2R5IG9ubHkKICAgICAgICAgIChwcm9nbgogICAg ICAgICAgICAobmcvZGVsZXRlLWN1cnJlbnQtbGluZSkpKQogICAgICAgIChidWZmZXItc3RyaW5n KSkpKQojK0VORF9TUkMKKiBTb3VyY2UgYmxvY2tzCioqIFNvdXJjZSBibG9jIDEKOlBST1BFUlRJ RVM6CjpJRDogICAgICAgNzAwMm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