From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Macros [was: Re: ATTR_HTML for a clickable image, howto?] Date: Thu, 05 Jul 2012 22:44:46 +0200 Message-ID: <871ukqrl8h.fsf@gmail.com> References: <86pqbrywgr.fsf@iro.umontreal.ca> <87r4w63602.fsf@gnu.org> <86vclekyqo.fsf@iro.umontreal.ca> <4F7EAED9.2040804@christianmoe.com> <4F803DDC.20808@christianmoe.com> <4F853CCD.4020601@christianmoe.com> <86r4ufr7hx.fsf_-_@mercure.progiciels-bpi.ca> <87wr2ijmoc.fsf@gnu.org> <8762a2s0rv.fsf@gmail.com> <803956gq9n.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmsyT-0003Bb-HP for emacs-orgmode@gnu.org; Thu, 05 Jul 2012 16:48:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmsyR-0001cp-LD for emacs-orgmode@gnu.org; Thu, 05 Jul 2012 16:48:29 -0400 Received: from plane.gmane.org ([80.91.229.3]:47373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmsyR-0001cA-59 for emacs-orgmode@gnu.org; Thu, 05 Jul 2012 16:48:27 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SmsyI-0006Jf-Kn for emacs-orgmode@gnu.org; Thu, 05 Jul 2012 22:48:18 +0200 In-Reply-To: <803956gq9n.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 05 Jul 2012 17:51:32 +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: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org Hello, "Sebastien Vauban" writes: > Hi Nicolas, > > Nicolas Goaziou wrote: >> Bastien writes: >>> Fran=C3=A7ois Pinard w= rites: >>>> If macros are there to stay in Org, it might be worth documenting a mo= re >>>> complete specification about how to define and use them. >>> >>> I'd welcome some improvement of the manual wrt macros -- any taker? >> >> Before documenting anything, we should first define them clearly. > > I think you're right here, seen the latest threads on this. > >> That is, we can define them through documentation, but we shouldn't write >> documentation by looking at their current implementation. >> >> Should macros be allowed anywhere (which means that the user can shoot >> himself in the foot) or should their expansion happen in a protected >> environment (thus limiting their power)? > > If I had to choose, I would opt for the first case... > >> In the first case, can macros generate inline Babel code, that will be >> executed before export? > > ... where macros would be pre-processed "=C3=A0 la M4" (or C preprocessin= g): > replacing some keyword with some other expression. > >> In the second case, what types of elements are allowed in the protected >> environment? >> >> Also, do we want to allow multiples macros definitions to stack up? I.e. >> >> #+MACRO: a-macro First line of the macro. >> #+MACRO: a-macro Second line of the macro. >> >> If so, do we allow blank lines in them, meaning they can break document >> structure even more? >> >> Can the macros be nested? >> >> Since macros arguments are comma-separated, how do one insert commas >> within an argument? >> >> Are newline characters allowed in arguments? If not, what else is >> forbidden there? >> >> There are probably other questions, but it should be a good start for >> a correct implementation. > > An extra question is: the "replacing expression" of a macro, must it be p= ure > text, or can it be anything (such as code that will be interpreted, in a > further pass, by some back-end)? The first option implies that the expression are inserted in the Org buffer before being parsed. This is mostly what happens in the current exporter. Regards, --=20 Nicolas Goaziou