From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Gary Oberbrunner <garyo@oberbrunner.com>
Cc: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: Macros or properties in source blocks
Date: Tue, 11 Aug 2015 17:41:37 -0700 [thread overview]
Message-ID: <alpine.OSX.2.11.1508111739510.1227@charles-berrys-macbook.local> (raw)
In-Reply-To: <CAFChFygSiGBNp8cs8fXRf9XjGiWpfLzzS5T-N=dyqL6v=VysTQ@mail.gmail.com>
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,
[snip]
BUT THIS DOES:
--8<---------------cut here---------------start------------->8---
#+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]
--8<---------------cut here---------------end--------------->8---
HTH,
Chuck
next prev parent reply other threads:[~2015-08-12 0:41 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 [this message]
2015-08-12 7:20 ` Sebastien Vauban
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
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=alpine.OSX.2.11.1508111739510.1227@charles-berrys-macbook.local \
--to=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
--cc=garyo@oberbrunner.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).