emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Sebastien Vauban
	<public-wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@plane.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org
Subject: Re: Macros [was: Re: ATTR_HTML for a clickable image, howto?]
Date: Thu, 05 Jul 2012 22:44:46 +0200	[thread overview]
Message-ID: <871ukqrl8h.fsf@gmail.com> (raw)
In-Reply-To: <803956gq9n.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 05 Jul 2012 17:51:32 +0200")



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Hi Nicolas,
>
> Nicolas Goaziou wrote:
>> Bastien <bzg-mXXj517/zsQ@public.gmane.org> writes:
>>> François Pinard <pinard-CRDzTM1onBSWkKpYnGOUKg@public.gmane.org> writes:
>>>> If macros are there to stay in Org, it might be worth documenting a more
>>>> 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 "à la M4" (or C preprocessing):
> 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 pure
> 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,

-- 
Nicolas Goaziou

  reply	other threads:[~2012-07-05 20:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01 21:27 ATTR_HTML for a clickable image, howto? François Pinard
2012-04-02  8:14 ` Bastien
2012-04-02 10:34   ` Christian Moe
2012-04-02 15:06     ` Bastien
2012-04-02 21:30       ` Samuel Wales
2012-04-03  5:42         ` Bastien
2012-04-05 23:34           ` Samuel Wales
2012-04-05 15:02   ` François Pinard
2012-04-06  8:52     ` Christian Moe
2012-04-06  9:29       ` Christian Moe
2012-04-06 18:41       ` Samuel Wales
2012-04-06 18:45         ` Samuel Wales
2012-04-07 13:15         ` Christian Moe
2012-04-10 23:53           ` Samuel Wales
2012-04-11  8:11             ` Christian Moe
2012-05-12  0:43               ` Samuel Wales
2012-05-20  1:00               ` Macros [was: Re: ATTR_HTML for a clickable image, howto?] François Pinard
2012-05-20  8:02                 ` Nicolas Goaziou
2012-05-20  8:34                   ` Yagnesh Raghava Yakkala
2012-05-20 10:24                     ` Nicolas Goaziou
2012-05-22 23:23                 ` Bastien
2012-07-05 14:40                 ` Bastien
2012-07-05 15:09                   ` Nicolas Goaziou
2012-07-05 15:51                     ` Sebastien Vauban
2012-07-05 20:44                       ` Nicolas Goaziou [this message]
2012-08-05  9:19                     ` Bastien
2012-05-20  0:39           ` ATTR_HTML for a clickable image, howto? François Pinard
2012-04-06  9:02     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ukqrl8h.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org \
    --cc=public-wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@plane.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).