emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: TIL about use of eval in user Org macros.. Documentation?
Date: Wed, 20 Dec 2017 22:30:16 +0000	[thread overview]
Message-ID: <CAFyQvY1htTzxL1OxVN-7zdaf-Ta4WV_Ja-1k3mp2vUunBbNNYg@mail.gmail.com> (raw)

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

Hello,

The commit message in this commit is golden:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3ac619c8ac9934a2a1368f3de8ffad951f900067

Using that info, I came up with a "classified" version of n macro for
markdown/HTML:

#+MACRO: sec (eval (concat "<span class=\"section-num\">" (number-to-string
(org-macro--counter-increment $1 $2)) "</span>"))

Based on that I have two questions:

1. Can you please document the use of eval form in Org macro definitions in
the Org manual(.org)? Its awesome wasn't evident to me until I read that
commit message.
2. (Another question on canonical approach) What would be the recommended
approach for an exporter backend to add new macros or override existing
macros (like "n" macro to wrap the string with HTML class as an example)?
Should it update org-macro-templates in org-export-before-processing-hook?
or something similar?
-- 

Kaushal Modi

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

             reply	other threads:[~2017-12-20 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 22:30 Kaushal Modi [this message]
2017-12-21  9:45 ` TIL about use of eval in user Org macros.. Documentation? Rasmus
2017-12-22 20:10   ` Samuel Wales
2017-12-25 10:26 ` Nicolas Goaziou

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=CAFyQvY1htTzxL1OxVN-7zdaf-Ta4WV_Ja-1k3mp2vUunBbNNYg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.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).