From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: nested macro expansion? Date: Thu, 20 Aug 2015 09:24:59 +0800 Message-ID: <87r3mypx90.fsf@ericabrahamsen.net> References: <87io8bo6uv.fsf@ericabrahamsen.net> <87egizo6mc.fsf@ericabrahamsen.net> <877forkp6d.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSEbb-0000et-Hp for emacs-orgmode@gnu.org; Wed, 19 Aug 2015 21:25:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSEbX-0000oZ-5t for emacs-orgmode@gnu.org; Wed, 19 Aug 2015 21:25:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:41076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSEbW-0000ne-VJ for emacs-orgmode@gnu.org; Wed, 19 Aug 2015 21:25:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZSEbM-0005on-0K for emacs-orgmode@gnu.org; Thu, 20 Aug 2015 03:25:08 +0200 Received: from 222.128.160.135 ([222.128.160.135]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Aug 2015 03:25:07 +0200 Received: from eric by 222.128.160.135 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Aug 2015 03:25:07 +0200 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@gnu.org Nicolas Goaziou writes: > Hello > > Eric Abrahamsen writes: > >> After googling for a while, I also thought this might work: >> >> #+MACRO: bubba (eval (format-time-string "%Y" property{{{TIMESTAMP}}})) >> >> {{{bubba}}} >> >> But the nested definition isn't expanded, either with or without >> quotes. > > As you noticed, you cannot nest macros. You can use macros within macro > definitions, tho. Alas, it will not work with (eval ...) templates, > since those make no assumptions about the rest of the template and > simply use `read' on it. > > Anyway, as pointed out in this thread, if you take the (eval ...) path, > you don't really need macros: you're in Elisp. Thanks to both of you for the pointers! This is my first time trying to do anything non-trivial with macros, and the orientation is very useful. Eric