all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Macros or properties in source blocks
Date: Wed, 12 Aug 2015 09:20:29 +0200	[thread overview]
Message-ID: <86pp2tkm6a.fsf@example.com> (raw)
In-Reply-To: alpine.OSX.2.11.1508111739510.1227@charles-berrys-macbook.local

"Charles C. Berry" <ccberry-XkckGZ689+c@public.gmane.org> writes:
> On Tue, 11 Aug 2015, Gary Oberbrunner wrote:
>
>> I'd like to have either a macro or a property that controls some behavior
>> of an org-mode babel file:
>>
>> #+PROPERTY: report_type All
>>
>> and use that property inline: {{{property(report_type)}}} and in a source
>> block:
>>
>> #+NAME: rtype
>> #+BEGIN_SRC emacs-lisp :results value
>> {{{property(report_type)}}}
>> #+END_SRC
>>
>> And use that source block:
>>
>> The report type is call_rtype()[:results raw]
>>
>> But this doesn't work,
>
> BUT THIS DOES:
>
> #+NAME: rtype
> #+header: :var prop=(org-entry-get (point) "report_type" t)
> #+BEGIN_SRC emacs-lisp
> prop
> #+END_SRC
>
> And use that source block:
>
> The report type is call_rtype()[:results raw]

Though, I don't understand either why your example did not work, as --
during the export process -- macros are supposed to be expanded before
Babel code be evaluated.

There must be some restriction, then, on which part of a document
a macro can reside in.

Best regards,
  Seb

-- 
Sebastien Vauban

  reply	other threads:[~2015-08-12  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 16:34 Macros or properties in source blocks Gary Oberbrunner
2015-08-12  0:41 ` Charles C. Berry
2015-08-12  7:20   ` Sebastien Vauban [this message]
2015-08-12 13:06     ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86pp2tkm6a.fsf@example.com \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.