Org-mode mailing list
 help / color / mirror / Atom feed
* Org-mode macros with variable argument number
@ 2020-10-12 18:46 Holger Pirk
  0 siblings, 0 replies; only message in thread
From: Holger Pirk @ 2020-10-12 18:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

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 nothing

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

    many thanks and best regards,


[-- Attachment #2: 0001-add-args-placeholder-to-macros-to-capture-all-argume.patch --]
[-- Type: application/octet-stream, Size: 1547 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-12 19:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 18:46 Org-mode macros with variable argument number Holger Pirk

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ \
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone