From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: Re: Macro expansion in new exporter Date: Tue, 12 Feb 2013 03:00:54 -0700 Message-ID: <8738x1x355.fsf@lapcat.tftorrey.com> References: <87wquhewvz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5CwP-0000Me-Ua for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:18:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5CwO-0004T9-Bz for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:18:21 -0500 Received: from mail-da0-f50.google.com ([209.85.210.50]:46233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5CwO-0004T2-6A for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:18:20 -0500 Received: by mail-da0-f50.google.com with SMTP id h15so3203908dan.9 for ; Tue, 12 Feb 2013 02:18:19 -0800 (PST) In-Reply-To: <87wquhewvz.fsf@gmail.com> (message from Nicolas Goaziou on Sat, 09 Feb 2013 09:04:16 +0100) 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hello again, Like many others, I'm adapting my workflow to the new exporter. Like Carsten (but apparently few others), I've been using macros extensively. Though I've spent several days digging through the mailing list and code, I still don't have the answers I need, but hopefully I can ask intelligent questions. Nicolas Goaziou writes: > On that topic, the main difference with the previous exporter is that > macros are now required to be in a context that can be parsed. Thus, for > example, the following is not a macro: > > ~{{{title}}}~ What is meant by "a context that can be parsed"? In my work, it has been very useful to use macros for snippets of text. Then, instead of changing the text everywhere when I want a change, I would just change the macro. So... For instance, I used to be able to do this: #+MACRO: status Draft #+HTML:

{{{status}}}

And on export to HTML, I would get what you would expect:

Draft

With the new exporter, the macro is left unexpanded in the output:

{{{status}}}

Of course, I could also put the {{{status}}} in any ordinary text and have it there as well. In extensive experiments, I have not found any combination of input that would produce the old output using macros. The old behavior had an elegant, one-line solution. Perhaps the functionality could be duplicated with babel, but surely not as simply and directly as with the old macro system. Is there a way to replicate the old behavior in the new export engine? Also, in your response to Carsten's question about macros, you suggested this: #+MACRO: thumbright @@html:./Content/$2/thumb.jpg@@ The "@@" syntax looks new to me. Can you tell me what the function of the "@@" is? Is this documented somewhere? Best regards, Terry -- T.F. Torrey