[Top][All Lists]

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

[O] Vararg macros, and code block as macro?

From: Diego Zamboni
Subject: [O] Vararg macros, and code block as macro?
Date: Thu, 26 Jul 2018 16:33:31 +0200


I have two somewhat related questions:

1. Is there a way for macros to check how many arguments were passed, and change its output depending on this? At the moment I found a solution using an =(eval...)= macro, which checks the values of $1, $2, etc. and produces the appropriate string. It works, but I wonder if there's a more org-native way.

2. Related to my workaround above, I am wondering if there's a way to refer to a source block as the macro definition. At the moment I just joined my whole elisp block into a single line for the macro definition, but I would love to have it in a proper source block so I can edit it properly, have indentation and syntax highlighting, etc.

If anyone is interested, here's my current code: https://raw.githubusercontent.com/zzamboni/zzamboni.org/master/content-org/zzamboni.org. You can see the "hsapi" macro, and a source block right below its definition, with the code, which for now has been joined together in the macro line.


reply via email to

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