emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Vararg macros, and code block as macro?
@ 2018-07-26 14:33 Diego Zamboni
  2018-07-26 15:21 ` Kaushal Modi
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Zamboni @ 2018-07-26 14:33 UTC (permalink / raw)
  To: Org-mode

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

Hi,

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.

Thanks!
--Diego

[-- Attachment #2: Type: text/html, Size: 1291 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-26 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26 14:33 Vararg macros, and code block as macro? Diego Zamboni
2018-07-26 15:21 ` Kaushal Modi
2018-07-26 15:39   ` Kaushal Modi
2018-07-26 19:01   ` Diego Zamboni

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).