From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Including file from a macro? Date: Wed, 27 Jun 2018 09:57:44 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000509291056f9af8e6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fY5Kr-0002uV-Ju for emacs-orgmode@gnu.org; Wed, 27 Jun 2018 03:57:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fY5Kl-0002yQ-6P for emacs-orgmode@gnu.org; Wed, 27 Jun 2018 03:57:51 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:43899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fY5Kk-0002xS-Sl for emacs-orgmode@gnu.org; Wed, 27 Jun 2018 03:57:47 -0400 Received: by mail-ed1-x52c.google.com with SMTP id u9-v6so523616eds.10 for ; Wed, 27 Jun 2018 00:57:46 -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" To: Org-mode --000000000000509291056f9af8e6 Content-Type: text/plain; charset="UTF-8" Hi, Is it possible to use "#+include" from within a macro? I have the following two files: t1.org: ----- #+MACRO: newline (eval "\n") #+MACRO: module-summary ** $1 {{{newline}}}{{{newline}}}#+include: "./$1.org::file-summary" {{{module-summary(t2)}}} ----- t2.org: ----- * t2 file #+name: file-summary This is the file summary ----- This is another paragraph If I export t1.org to org-mode, I get the following, which, if exported to any other format (I have tested HTML and Markdown), correctly includes the "file-summary" paragraph: t1.org.org: ----- # Created 2018-06-27 Wed 09:26 #+TITLE: #+AUTHOR: Zamboni Diego #+macro: newline (eval "\n") #+macro: module-summary ** $1 {{{newline}}}{{{newline}}}#+include: "./$1.org::file-summary" * t2 #+include: "./t2.org::file-summary" ----- However, if I export t1.org directly to HTML or Markdown, I get only the heading "* t2", but no included contents, as if the #+include line is not being processed correctly. Any ideas if this is possible? Thanks, --Diego --000000000000509291056f9af8e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Is it possible to use "#+inclu= de" from within a macro?

I have the following= two files:

t1.org:<= /div>
-----
#+MACRO: newline =C2=A0 =C2=A0(eval "\n= ")
#+MACRO: module-summary ** $1 {{{newline}}}{{{newline}}}#= +include: "./$1.org::file-summary"

{{{mo= dule-summary(t2)}}}
-----

-----
* t2 file

#+name: file-summary
This is the file summa= ry
-----

This is another paragraph
=

If I export t1.org = to org-mode, I get the following, which, if exported to any other format (I= have tested HTML and Markdown), correctly includes the "file-summary&= quot; paragraph:

-----
# Created 2018-06-27 Wed 09:26<= /div>
#+TITLE:
#+AUTHOR: Zamboni Diego
#+macro: new= line =C2=A0 =C2=A0(eval "\n")
#+macro: module-summary *= * $1 {{{newline}}}{{{newline}}}#+include: "./$1.org::file-summary"= ;

* t2

#+include: ".= /t2.org::file-summary"
-----

= However, if I export t1.org directly to HTML = or Markdown, I get only the heading "* t2", but no included conte= nts, as if the #+include line is not being processed correctly.
<= br>
Any ideas if this is possible?

Thank= s,
--Diego

--000000000000509291056f9af8e6--