emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to extract header arguments of a special block?


From: Charles C. Berry
Subject: Re: [O] How to extract header arguments of a special block?
Date: Tue, 20 Jan 2015 09:45:09 -0800
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)

On Tue, 20 Jan 2015, Marcin Borkowski wrote:

Hello Orgers,

assume that I have this in my Org file:

#+BEGIN_FOO :bar baz qux
whatever
#+END_FOO

and I want to extract the value of the header argument "bar" (i.e., the
string "baz qux" in this case).  How do I do it?  (I'm writing – still –
the custom exporter, and would like to be able to set something
spearately for each special block of some kind.)

It will be easier to use a src block for a faux language (say FOO).

Customize `org-babel-execute:FOO' as needed and you should be set:

#+BEGIN_SRC emacs-lisp
  (defun org-babel-execute:FOO (body params &optional etc)
    (concat  body (format " %S" (assoc :bar params))))
#+END_SRC

#+RESULTS:
: org-babel-execute:FOO

#+NAME: example1
#+BEGIN_SRC FOO :bar baz qux :exports results
whatever
#+END_SRC

#+RESULTS: example1
: whatever (:bar . "baz qux")

HTH,

Chuck

reply via email to

[Prev in Thread] Current Thread [Next in Thread]