2011/3/5 Sébastien Vauban <wxhgmqzgw...@spammotel.com>: > Hi Benny, > > Benny Simonsen wrote: >> 2011/3/2 Benny Simonsen <be...@slbs.dk>: >>> I would like to use macros in files that I include in another file. >>> The problem is that the macros don't expand in included files. Is >>> there something I have missed or? >>> >>> Example with two files, main.org and sub.org >>> >>> = main.org START ======== >>> #+TITLE: Mainpage >>> #+MACRO: MacM @<strong>$1@</strong> >>> >>> {{{MacM(Main)}}} >>> >>> #+INCLUDE: "sub.org" >>> = main.org END ======== >>> >>> = sub.org START ======== >>> #+TITLE: Subpage >>> #+MACRO: Mac @<strong>$1@</strong> >>> >>> {{{MacM(Sub)}}} >>> >>> {{{Mac(Sub)}}} >>> >>> * Subpage title >>> content >>> = sub.org END ======== >>> >>> I export to html e.g. via: >>> org-export-as-html-to-buffer on main.org >>> >>> The result is >>> {{{MacM(Main)}}} is expanded as expected but the {{{Mac*(Sub)}}} isn't >>> expanded. > > Your example looks wrong to me: you say Mac* is not working, but only MacM and > Mac are defined. What about the trailing the star? >
The * was just a wildcard so Mac* means MacM and Mac. A brief summary MacM is defined in main.org - and expands in this file. Mac is defined in sub.org - but neither MacM or Mac works in sub.org. With my patch MacM works in both files, but Mac don't work - not a problem for me - but not nice. Best regards Benny