From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: How to extract header arguments of a special block? Date: Tue, 20 Jan 2015 09:45:09 -0800 Message-ID: References: <877fwigutt.fsf@wmi.amu.edu.pl> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-504530011-1421775910=:476" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDczN-0002XQ-GL for emacs-orgmode@gnu.org; Tue, 20 Jan 2015 12:53:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDczK-00043I-0j for emacs-orgmode@gnu.org; Tue, 20 Jan 2015 12:53:17 -0500 Received: from iport-bcv1-out.ucsd.edu ([132.239.0.119]:35128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDczJ-00042b-Nq for emacs-orgmode@gnu.org; Tue, 20 Jan 2015 12:53:13 -0500 In-Reply-To: <877fwigutt.fsf@wmi.amu.edu.pl> 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: Marcin Borkowski Cc: Org-Mode mailing list This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-504530011-1421775910=:476 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT 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 --0-504530011-1421775910=:476--