From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: Macros or properties in source blocks Date: Wed, 12 Aug 2015 09:20:29 +0200 Message-ID: <86pp2tkm6a.fsf@example.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org "Charles C. Berry" 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