From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Macros or properties in source blocks Date: Tue, 11 Aug 2015 17:41:37 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPK71-0004tr-G9 for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 20:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPK6y-0007jd-Ah for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 20:41:47 -0400 Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:17267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPK6y-0007eP-1S for emacs-orgmode@gnu.org; Tue, 11 Aug 2015 20:41:44 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gary Oberbrunner Cc: Orgmode Mailing List 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