emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Diego Zamboni <diego@zzamboni.org>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Including file from a macro?
Date: Wed, 27 Jun 2018 09:57:44 +0200	[thread overview]
Message-ID: <CAGY83EfrfDfSaKj=zGfitqLWzHXaZAbY4v1PWqwJ+SSNUkUEaQ@mail.gmail.com> (raw)

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

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

[-- Attachment #2: Type: text/html, Size: 1820 bytes --]

             reply	other threads:[~2018-06-27  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27  7:57 Diego Zamboni [this message]
2018-06-27  8:01 ` Including file from a macro? Nicolas Goaziou
2018-06-27  9:28   ` Diego Zamboni
2018-06-27 16:42     ` Berry, Charles

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='CAGY83EfrfDfSaKj=zGfitqLWzHXaZAbY4v1PWqwJ+SSNUkUEaQ@mail.gmail.com' \
    --to=diego@zzamboni.org \
    --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).