From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Olaf.Hamann" Subject: [babel] would like to to do simple text block expansion with parameters or multiline macro replacement text Date: Sat, 07 Apr 2012 19:22:00 +0200 Message-ID: <4F8077B8.2010603@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGZji-0007bA-7u for emacs-orgmode@gnu.org; Sat, 07 Apr 2012 13:47:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGZjg-0000Hj-Ck for emacs-orgmode@gnu.org; Sat, 07 Apr 2012 13:47:41 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:38854) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SGZjg-0000HL-34 for emacs-orgmode@gnu.org; Sat, 07 Apr 2012 13:47:40 -0400 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: Emacs-orgmode mailing list Hello all, I'm very happy with all the new features I discovered in org-babel (since 6.8 or so) and played around a lot trying to convert my old funnelweb-techniques (kind of LPstuff) into org-babel and now I'm a little confused with all that elaborated stuff like header arguments, result options :var types and function calls and so on :-) Is there an easy way to do a simple text block expansion with parameters, I mean sth like this: #+begin_src xsl :tangle outputfile :noweb tangle {{{gCV(argument1,param2)}}} <> #+end_src #+MACRO: gCV replacement text... ...spread over different... ...multiple lines with arguments like $1 ... ...and $2 and so on... ... #+end_macro Multiline macros did not work in my tries (Org version 7.8.03 with Emacs version 24) For expanding macros inside srcblocks I got this hint from the list some time ago what works really fine: #+begin_src emacs-lisp :results silent :exports none (add-hook 'org-babel-tangle-body-hook (lambda () (org-export-preprocess-apply-macros))) #+end_src Below I give an executable example in org-code. It's stripped down from my work. It works fine, but I would like to get rid of the lisp-concat and string-quoting and wonder if org-mode does not offer another way. Thank you very much in advance, Olaf ==== * simple text block expansion with parameters #+NAME: gCV(PDEF="param_pdef",XPATH="param_value") #+begin_src emacs-lisp :results value :exports results :noweb tangle (concat " " ) #+end_src #+begin_src xsl :tangle mappings.xslt :noweb tangle <> <> #+end_src ==== Output looks like expected: