From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Bug? : Nested macro expansion Date: Thu, 6 Dec 2012 15:48:48 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=005045016f07ce9d0c04d03539eb Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgiNJ-0002Ok-MZ for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 15:48:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgiNI-0007DT-FZ for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 15:48:53 -0500 Received: from mail-qa0-f41.google.com ([209.85.216.41]:46965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgiNI-0007DN-Ab for emacs-orgmode@gnu.org; Thu, 06 Dec 2012 15:48:52 -0500 Received: by mail-qa0-f41.google.com with SMTP id o19so1505941qap.0 for ; Thu, 06 Dec 2012 12:48:49 -0800 (PST) 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: Org Mode Mailing List --005045016f07ce9d0c04d03539eb Content-Type: text/plain; charset=UTF-8 Hello all, When trying to insert a macro as one of the variables in another macro (inline and not in the definition), the export fails in both exporters in different ways. Using the following example: #+begin_src org #+MACRO: test2 /$1/ #+MACRO: test3 *$1* #+MACRO: test {{{test2($1)}}} - $2 #+MACRO: test4 $1 - $2 Test 1. {{{test(hello,goodbye)}}} 2. {{{test(hello, {{{test3(goodbye)}}})}}} 3. {{{test({{{test3(hello)}}},goodbye)}}} 4. {{{test4({{{test3(hello)}}},goodbye)}}} 5. {{{test4(hello,{{{test3(goodbye)}}})}}} #+end_src Old exporter (ascii): Test ==== 1. /hello/ - goodbye 2. /hello/ - *goodbye* 3. /*hello/ - goodbye* 4. *hello - goodbye* 5. hello - *goodbye* New exporter (org-e-ascii-as-ascii): Test 1. /hello/ - goodbye 2. /hello/ - *goodbye* 3. /{{{test3(hello/ - ,goodbye)}}} 4. *hello -* 5. hello - *goodbye* The issues are with examples 3 and 4, where the interior macro does not close any markup until after the end of the exterior macro. The new exporter is particularly bad, since in 3 it does not even expand the internal macro (although it does expand it if it is part of the original definition), and in 4 it completely omits $2 when creating the expansion. Regards, -- Jon --005045016f07ce9d0c04d03539eb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello all,

When trying to insert a macro as one of the variables in = another macro
(inline and not in the definition), the export fails in bo= th exporters
in different ways.

Using the following example:

#+begin_src org
#+MACRO: test2 /$1/
#+MACRO: test3 *$1*
#+MACR= O: test {{{test2($1)}}} - $2
#+MACRO: test4 $1 - $2

Test
1. {{= {test(hello,goodbye)}}}
2. {{{test(hello, {{{test3(goodbye)}}})}}}
3. {{{test({{{test3(hello)}}},goodbye)}}}
4. {{{test4({{{test3(hello)}}}= ,goodbye)}}}
5. {{{test4(hello,{{{test3(goodbye)}}})}}}
#+end_src
=
Old exporter (ascii):

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Test
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D=3D=3D=3D
1. /hello/ - goo= dbye
2. /hello/ - *goodbye*
3. /*hello/ - goodbye*
4. *hello - goo= dbye*
5. hello - *goodbye*

New exporter (org-e-ascii-as-ascii):
Test
1. /hello/ - goodbye
2. /hello/ - *goodbye*
3. /{{{test3(hello/ - ,go= odbye)}}}
4. *hello -*
5. hello - *goodbye*


The issues are= with examples 3 and 4, where the interior macro does
not close any mark= up until after the end of the exterior macro.=C2=A0 The
new exporter is particularly bad, since in 3 it does not even expand
the= internal macro (although it does expand it if it is part of the
origina= l definition), and in 4 it completely omits $2 when creating
the expansi= on.

Regards,

--
Jon
--005045016f07ce9d0c04d03539eb--