emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: Joon Ro <joon.ro@outlook.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Questions about using macro replacement
Date: Sat, 26 Aug 2017 17:44:03 -0400	[thread overview]
Message-ID: <CAN_Dec9si6wmwh=UJUa0nGjfiTB0uDS0mHqhK2ZzV0maD67KEg@mail.gmail.com> (raw)
In-Reply-To: <BY2PR15MB04217BB07669D2F0D829F4C5EB9A0@BY2PR15MB0421.namprd15.prod.outlook.com>

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

Answering without full knowledge!

On Wed, Aug 23, 2017 at 11:13 PM, Joon Ro <joon.ro@outlook.com> wrote:

> Hi,
>
> I have several questions about macro replacement usage.
>
> 1. I saw people using {{{n}}} macros, which looks very useful, but I could
> not find it in current documentation about macro replacement (
> http://orgmode.org/manual/Macro-replacement.html). Is this only available
> in developmental version?
>
> Yes, I'm pretty sure this has not been merged yet

2. I was wondering if it is possible use macro expansion
> for :EXPORT_FILE_NAME: property of a subtree?
>
Since macros can be set to expand to arbitrary elisp, I would think this
*should* be possible.  I forget the syntax but something like:

#+MACRO: efn (eval (get-export-file-name))

#+BEGIN_SRC emacs-lisp
(defun get-export-file-name ()
 (org-element-property :export-file-name (org-element--current-element) ))
#+END_SRC

* some heading
:PROPERTIES
:EXPORT_FILE_NAME: test-me
:END:

will get you somewhat close.  I don't understand the org-element api very
well though and it generally takes me a few tries to get this sort of thing
right.

3. Is it possible to create a file link which uses macro? I would like to
> create a link to the exported pdf file dynamically. For example, if the
> value of :EXPORT_FILE_NAME: is exported, how would I create a link which
> automatically link to exported.pdf?
>

I don't think a macro will do this for you since, if I understand
correctly, macros are not aware of the export target.  So probably you
would need some other mechanism to od this.

>
> Any help would be greatly appreciated. Thank you!
> Joon
>
>

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

  reply	other threads:[~2017-08-26 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  3:13 Questions about using macro replacement Joon Ro
2017-08-26 21:44 ` Matt Price [this message]
2017-08-26 23:56   ` Joon Ro

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='CAN_Dec9si6wmwh=UJUa0nGjfiTB0uDS0mHqhK2ZzV0maD67KEg@mail.gmail.com' \
    --to=moptop99@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=joon.ro@outlook.com \
    /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).