[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Org-mode macros with variable argument number

From: Holger Pirk
Subject: Org-mode macros with variable argument number
Date: Mon, 12 Oct 2020 18:46:41 +0000

Hi folks,

For a while, I have been bugged by the fact that org-mode macros need to 
hardcode the arguments. Among other things, this prevents, macros with a 
variable number of arguments (arguably most useful for “(eval”-style lisp 
macros). Today, I finally implemented this feature (see attached patch). It 
simply substitutes $arg with a list of the macro arguments.

It allows macros like this one: 

#+MACRO: no-op (eval (string-join $args ","))

Which simple outputs its arguments but does not require calls to the macro to 
escape commas.

{{{no-op(Hi there, this macro does nothing)}}} -> Hi there, this macro does 

Can you have a look to see if this can be included in the org-mode distribution?

    many thanks and best regards,


Attachment: 0001-add-args-placeholder-to-macros-to-capture-all-argume.patch
Description: 0001-add-args-placeholder-to-macros-to-capture-all-argume.patch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]