From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Jarmo Hurri <jarmo.hurri@iki.fi>
Cc: emacs-orgmode@gnu.org
Subject: Re: Multi-line macros (again)
Date: Sun, 09 Oct 2016 11:25:00 +0200 [thread overview]
Message-ID: <87y41xkh77.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87int49z1k.fsf@iki.fi> (Jarmo Hurri's message of "Fri, 07 Oct 2016 14:30:31 +0300")
Hello,
Jarmo Hurri <jarmo.hurri@iki.fi> writes:
> One of the most useful properties of LaTeX is \newcommand, which allows
> you to reuse document structures. I really, _really_ miss this feature
> in Org. Org has #+MACRO, but it is limited to a single line. That is
> very inconvenient for any larger structures.
Of course, macro are inconvenient for complex structures. They are not
the right tool for the job. You could use Babel for that, e.g.,
#+name: template
#+header: :var x="" y=""
#+header: :results silent
#+begin_src org
$x
$y
#+end_src
#+call: template("line 1", "line 2") :results replace
#+RESULTS:
line 1
line 2
> Could we have multiline macros, something like
>
> #+BEGIN_MACRO name
> #+END_MACRO
For the record, I think that block syntax is largely overloaded. I'd
rather not introduce a new type of block without a really good reason.
Anyway, is there anything wrong with Babel, as suggested above?
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2016-10-09 9:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 11:30 Multi-line macros (again) Jarmo Hurri
2016-10-09 9:25 ` Nicolas Goaziou [this message]
2016-10-12 9:56 ` Rasmus
2016-10-12 10:22 ` Nicolas Goaziou
2016-10-12 10:29 ` Rasmus
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=87y41xkh77.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=jarmo.hurri@iki.fi \
/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).