From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benny Simonsen Subject: Re: Macro expansion in included files Date: Sat, 5 Mar 2011 18:55:39 +0100 Message-ID: References: <80oc5plkyd.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=39171 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pvvi2-0002t2-QW for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 12:56:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pvvhc-0004Iz-Q1 for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 12:55:41 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:62497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pvvhc-0004Iv-Kh for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 12:55:40 -0500 Received: by vxc38 with SMTP id 38so3549568vxc.0 for ; Sat, 05 Mar 2011 09:55:39 -0800 (PST) In-Reply-To: <80oc5plkyd.fsf@somewhere.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org 2011/3/5 S=E9bastien Vauban : > Hi Benny, > > Benny Simonsen wrote: >> 2011/3/2 Benny Simonsen : >>> 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 >>> >>> =3D main.org START =3D=3D=3D=3D=3D=3D=3D=3D >>> #+TITLE: Mainpage >>> #+MACRO: MacM @$1@ >>> >>> {{{MacM(Main)}}} >>> >>> #+INCLUDE: "sub.org" >>> =3D main.org END =3D=3D=3D=3D=3D=3D=3D=3D >>> >>> =3D sub.org START =3D=3D=3D=3D=3D=3D=3D=3D >>> #+TITLE: Subpage >>> #+MACRO: Mac @$1@ >>> >>> {{{MacM(Sub)}}} >>> >>> {{{Mac(Sub)}}} >>> >>> * Subpage title >>> content >>> =3D sub.org END =3D=3D=3D=3D=3D=3D=3D=3D >>> >>> 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 Mac= M 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