From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: Arun Isaac <arunisaac@systemreboot.net>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Defining macros globally
Date: Mon, 19 Dec 2016 23:04:14 +0100 [thread overview]
Message-ID: <8760mf1spt.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <alpine.OSX.2.20.1612191035520.1032@charles-berrys-macbook.local> (Charles C. Berry's message of "Mon, 19 Dec 2016 10:41:31 -0800")
Hello,
"Charles C. Berry" <ccberry@ucsd.edu> writes:
> On Mon, 19 Dec 2016, Nicolas Goaziou wrote:
>
>> Hello,
>>
>> Arun Isaac <arunisaac@systemreboot.net> writes:
>>
>>> Is it possible to define macros globally, probably in the ~/.emacs init
>>> file with some elisp, instead of on a per-file basis using the #+MACRO
>>> keyword?
>>
>> This is not possible ATM.
>
> Perhaps the OP could do this?
>
> #+BEGIN_SRC emacs-lisp
> (setq my-new-macros
> '(("def" . "d $1 e $2 f")
> ("ghi" . "GHI only")))
>
> (defun add-my-macros (&rest x)
> (nconc org-macro-templates my-new-macros))
>
> (advice-add 'org-macro-initialize-templates :filter-return
> #'add-my-macros)
>
>
> #+END_SRC
>
> Admittedly, this invites problems if `my-new-macros' is malformed. But
> there could be ways to impose a discipline that would assure that it is
> not.
I added `org-export-global-macros' in master. It's Christmas, after all.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2016-12-19 22:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 13:40 Defining macros globally Arun Isaac
2016-12-19 15:10 ` Nicolas Goaziou
2016-12-19 18:41 ` Charles C. Berry
2016-12-19 22:04 ` Nicolas Goaziou [this message]
2016-12-20 10:00 ` Arun Isaac
2016-12-19 17:59 ` Kaushal Modi
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=8760mf1spt.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=arunisaac@systemreboot.net \
--cc=ccberry@ucsd.edu \
--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).